diff --git a/classes/task/check_recompletion.php b/classes/task/check_recompletion.php index fb7e81d..30e9190 100644 --- a/classes/task/check_recompletion.php +++ b/classes/task/check_recompletion.php @@ -122,8 +122,9 @@ public function execute() { if (!isset($updateresettimes[$course->id]) && isset($user->schedule)) { // Update next reset time. $newconfig = new \stdClass(); - if (isset($rc['nextresettime'])) { - $newconfig->id = $rc['nextresettime']->id; + if (isset($config->nextresettime)) { + $newconfig->id = $DB->get_field('local_recompletion_config', 'id', + ['course' => $course->id, 'name' => 'nextresettime']); } $newconfig->course = $course->id; $newconfig->name = 'nextresettime';