diff --git a/calendar/lib.php b/calendar/lib.php index 8b9e480f9b065..046c0a9b307a5 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1796,7 +1796,7 @@ public function __isset($key) { * @return stdClass */ protected function calculate_context(stdClass $data) { - global $USER; + global $USER, $DB; $context = null; if (isset($data->courseid) && $data->courseid > 0) {