fixing a warning in calendar

This commit is contained in:
toyomoyo
2007-09-20 02:57:17 +00:00
parent 8397874d1b
commit edeed697de
+1 -1
View 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