]> git.mjollnir.org Git - moodle.git/commitdiff
fixing a warning in calendar
authortoyomoyo <toyomoyo>
Thu, 20 Sep 2007 02:57:17 +0000 (02:57 +0000)
committertoyomoyo <toyomoyo>
Thu, 20 Sep 2007 02:57:17 +0000 (02:57 +0000)
calendar/lib.php

index 5dbb42849a65a416e03617137f02837e61669d93..e0158616fa7839c3db2d9785e0c61f1ca4ca8007 100644 (file)
@@ -1321,7 +1321,7 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
                 }
 
                 // If the user is an editing teacher in there,
-                if (!empty($USER->id) && has_capability('moodle/calendar:manageentries', $courseeventsfrom[$courseid]->context)) {
+                if (!empty($USER->id) && isset($courseeventsfrom[$courseid]->context) && has_capability('moodle/calendar:manageentries', $courseeventsfrom[$courseid]->context)) {
                     // If this course has groups, show events from all of them
                     if(is_int($groupeventsfrom)) {
                         if (is_object($courseeventsfrom[$courseid])) { // SHOULD be set MDL-11221