]> git.mjollnir.org Git - moodle.git/commitdiff
fixed validation of course category for site course MDL-6715
authorskodak <skodak>
Wed, 27 Sep 2006 20:43:04 +0000 (20:43 +0000)
committerskodak <skodak>
Wed, 27 Sep 2006 20:43:04 +0000 (20:43 +0000)
lib/accesslib.php

index d9187825d821dc5b62dd08d601dca432ea4a8999..16e625d589c450bea88e2bfc374459a5f582d843 100755 (executable)
@@ -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: