diff --git a/course/classes/category.php b/course/classes/category.php index a52878ee411..a1a3ec0eab2 100644 --- a/course/classes/category.php +++ b/course/classes/category.php @@ -272,7 +272,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr if (!$coursecat) { // Course category not found. if ($strictness == MUST_EXIST) { - throw new moodle_exception('unknowncategory'); + throw new moodle_exception('unknowncategory', a: $id); } $coursecat = null; } else if (!$alwaysreturnhidden && !$coursecat->is_uservisible($user)) { diff --git a/lib/pagelib.php b/lib/pagelib.php index e2fc934c651..ed61453cab0 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -2178,7 +2178,7 @@ class moodle_page { global $DB; $category = $DB->get_record('course_categories', array('id' => $categoryid)); if (!$category) { - throw new moodle_exception('unknowncategory'); + throw new moodle_exception('unknowncategory', a: $categoryid); } $this->_categories[$category->id] = $category; $parentcategoryids = explode('/', trim($category->path, '/'));