From 944a06edb6745801a5d104f5db00ffe3bc62b066 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Wed, 21 Feb 2024 12:34:28 +0100 Subject: [PATCH] lifecycletrigger_categories: Don't fail if category doesn't exist --- trigger/categories/lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trigger/categories/lib.php b/trigger/categories/lib.php index 97ed716f..9d0ca44c 100644 --- a/trigger/categories/lib.php +++ b/trigger/categories/lib.php @@ -76,6 +76,9 @@ public function get_course_recordset_where($triggerid) { $allcategories = []; foreach ($categories as $category) { array_push($allcategories, $category); + if (!isset($categoryobjects[$category])) { + continue; + } $children = $categoryobjects[$category]->get_all_children_ids(); $allcategories = array_merge($allcategories, $children); }