From 0755d726ab6dc29234b5883c4301bcd132e25a77 Mon Sep 17 00:00:00 2001 From: ScottVerbeek Date: Fri, 27 Sep 2024 10:53:20 +1000 Subject: [PATCH] Allow steps to run when course no longer exits (#222) --- classes/processor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {