Commit b974b5d0 authored by Jake Dallimore's avatar Jake Dallimore
Browse files

Merge branch 'MDL-60587-master-4' of git://github.com/andrewnicols/moodle

parents bb2071ca 1ab85831
......@@ -48,8 +48,8 @@ class block_calendar_month extends block_base {
$this->content->text = '';
$this->content->footer = '';
$courseid = isset($this->page->course) ? $this->page->course->id : SITEID;
$categoryid = isset($this->page->category) ? $this->page->category->id : null;
$courseid = $this->page->course->id;
$categoryid = ($this->page->context->contextlevel === CONTEXT_COURSECAT) ? $this->page->category->id : null;
$calendar = \calendar_information::create(time(), $courseid, $categoryid);
list($data, $template) = calendar_get_view($calendar, 'mini');
......
......@@ -47,8 +47,8 @@ class block_calendar_upcoming extends block_base {
$this->content->text = '';
$this->content->footer = '';
$courseid = isset($this->page->course) ? $this->page->course->id : SITEID;
$categoryid = isset($this->page->category) ? $this->page->category->id : null;
$courseid = $this->page->course->id;
$categoryid = ($this->page->context->contextlevel === CONTEXT_COURSECAT) ? $this->page->category->id : null;
$calendar = \calendar_information::create(time(), $courseid, $categoryid);
list($data, $template) = calendar_get_view($calendar, 'upcoming_mini');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment