MDL-14460, fix get_context_instance, merged from MOODLE_19_STABLE, see tracker.
[moodle.git] / calendar / view.php
index a8c9431..6eb8184 100644 (file)
@@ -608,7 +608,7 @@ function calendar_course_filter_selector($getvars = '') {
         return '';
     }
 
-    if (has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM, SITEID)) && !empty($CFG->calendar_adminseesall)) {
+    if (has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM)) && !empty($CFG->calendar_adminseesall)) {
         $courses = get_courses('all', 'c.shortname','c.id,c.shortname');
     } else {
         $courses = get_my_courses($USER->id, 'shortname');