From: toyomoyo Date: Thu, 20 Sep 2007 02:57:17 +0000 (+0000) Subject: fixing a warning in calendar X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=edeed697deb16044ee20c8f9804b5d0f8a669016;p=moodle.git fixing a warning in calendar --- diff --git a/calendar/lib.php b/calendar/lib.php index 5dbb42849a..e0158616fa 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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