From 5e8e87aaee2d8f003b4b95fe555ca6b40ab214dd Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Mon, 20 Nov 2017 12:06:47 +0800 Subject: [PATCH] MDL-60806 core_calendar: return hidden categories --- calendar/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index 4790d705e8a..26af6c18c7a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1056,7 +1056,7 @@ class calendar_information { } $courses = [$course->id => $course]; - $category = (\coursecat::get($course->category))->get_db_record(); + $category = (\coursecat::get($course->category, MUST_EXIST, true))->get_db_record(); } else if (!empty($categoryid)) { $course = get_site(); $courses = calendar_get_default_courses(); @@ -1147,7 +1147,7 @@ class calendar_information { // A specific course was requested. // Fetch the category that this course is in, along with all parents. // Do not include child categories of this category, as the user many not have enrolments in those siblings or children. - $category = \coursecat::get($course->category); + $category = \coursecat::get($course->category, MUST_EXIST, true); $this->categoryid = $category->id; $this->categories = $category->get_parents();