diff --git a/classes/recompletion_form.php b/classes/recompletion_form.php index 25893ad..c143fa5 100644 --- a/classes/recompletion_form.php +++ b/classes/recompletion_form.php @@ -64,7 +64,7 @@ public function definition() { self::RECOMPLETION_TYPE_ONDEMAND => get_string('recompletiontype:ondemand', 'local_recompletion'), self::RECOMPLETION_TYPE_SCHEDULE => get_string('recompletiontype:schedule', 'local_recompletion'), ]); - $mform->setDefault('recompletiontype', $config->recompletiontype ?? ''); + $mform->setDefault('recompletiontype', RECOMPLETION_TYPE_DISABLED); $mform->addHelpButton('recompletiontype', 'recompletiontype', 'local_recompletion'); $mform->addElement('checkbox', 'recompletionemailenable', get_string('recompletionemailenable', 'local_recompletion')); diff --git a/classes/task/check_recompletion.php b/classes/task/check_recompletion.php index b092e1d..c841f91 100644 --- a/classes/task/check_recompletion.php +++ b/classes/task/check_recompletion.php @@ -259,6 +259,7 @@ public function reset_user($userid, $course, $config = null) { } if (empty($config->recompletiontype)) { $errors[] = get_string('recompletionnotenabledincourse', 'local_recompletion', $course->id); + return $errors; } $restrictions = local_recompletion_get_supported_restrictions();