From 1cd3eba948664d88519341fe799984631b028eb7 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 27 Sep 2006 20:43:04 +0000 Subject: [PATCH] fixed validation of course category for site course MDL-6715 --- lib/accesslib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/accesslib.php b/lib/accesslib.php index d9187825d8..16e625d589 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1182,6 +1182,9 @@ function validate_context($contextlevel, $instanceid) { return (boolean)count_records('user', 'id', $instanceid); case CONTEXT_COURSECAT: + if ($instanceid == 0) { + return true; // site course category + } return (boolean)count_records('course_categories', 'id', $instanceid); case CONTEXT_COURSE: -- 2.39.5