From 9f06f9c4f9bbd71bda1195bce3a61a72c543b60e Mon Sep 17 00:00:00 2001 From: guillermogomez Date: Tue, 23 Jan 2024 17:51:35 -0500 Subject: [PATCH] Issue #142: Get config id for nextresettime --- classes/task/check_recompletion.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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';