From c3f4abed6f876479d094c538270858e57d3bb23c Mon Sep 17 00:00:00 2001 From: Mario Wehr Date: Sat, 28 Dec 2019 12:05:45 +0100 Subject: [PATCH] MDL-67204 assign task: Use lastruntime from task_scheduled --- mod/assign/locallib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 311932cc4d0..c6c6b405ea1 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2495,7 +2495,7 @@ class assign { // Only ever send a max of one days worth of updates. $yesterday = time() - (24 * 3600); $timenow = time(); - $lastcron = $DB->get_field('modules', 'lastcron', array('name' => 'assign')); + $lastruntime = $DB->get_field('task_scheduled', 'lastruntime', array('component' => 'mod_assign')); // Collect all submissions that require mailing. // Submissions are included if all are true: @@ -2667,10 +2667,10 @@ class assign { $sql = 'SELECT id FROM {assign} WHERE - allowsubmissionsfromdate >= :lastcron AND + allowsubmissionsfromdate >= :lastruntime AND allowsubmissionsfromdate <= :timenow AND alwaysshowdescription = 0'; - $params = array('lastcron' => $lastcron, 'timenow' => $timenow); + $params = array('lastruntime' => $lastruntime, 'timenow' => $timenow); $newlyavailable = $DB->get_records_sql($sql, $params); foreach ($newlyavailable as $record) { $cm = get_coursemodule_from_instance('assign', $record->id, 0, false, MUST_EXIST);