diff --git a/classes/processor.php b/classes/processor.php index 81a0e73f..9d2925d0 100644 --- a/classes/processor.php +++ b/classes/processor.php @@ -102,8 +102,9 @@ public function process_courses() { try { $course = get_course($process->courseid); } catch (\dml_missing_record_exception $e) { - // Course no longer exists! - break; + mtrace("The course with id {$process->courseid} no longer exists. New stdClass with id property is created."); + $course = new \stdClass(); + $course->id = $process->courseid; } if ($process->stepindex == 0) {