From: Jun Pataleta Date: Wed, 12 Sep 2018 07:34:59 +0000 (+0800) Subject: Merge branch 'mdl63321-master' of https://github.com/tlock/moodle X-Git-Tag: v3.6.0-beta~415 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=d1ae9c72c6e04bf493c1b75d3dd73ce97637375d;hp=19d8da756119024f0952e6e4657f851c1e043f8a Merge branch 'mdl63321-master' of https://github.com/tlock/moodle --- diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index 00547c6b365..64c2cd273d8 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -49,7 +49,8 @@ class block_calendar_month extends block_base { $this->content->footer = ''; $courseid = $this->page->course->id; - $categoryid = ($this->page->context->contextlevel === CONTEXT_COURSECAT) ? $this->page->category->id : null; + $categoryid = ($this->page->context->contextlevel === CONTEXT_COURSECAT && !empty($this->page->category)) ? + $this->page->category->id : null; $calendar = \calendar_information::create(time(), $courseid, $categoryid); list($data, $template) = calendar_get_view($calendar, 'mini', isloggedin(), isloggedin());