Commit 7b3fdc47 authored by Andrew Nicols's avatar Andrew Nicols Committed by Jenkins
Browse files

MDL-68974 calendar: Use page context for block check

parent e0b4a480
......@@ -1268,9 +1268,12 @@ class calendar_information {
* @param string|null $view preference view options (eg: day, month, upcoming)
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
if (!has_capability('moodle/block:view', $this->context) ) {
global $PAGE;
if (!has_capability('moodle/block:view', $PAGE->context) ) {
if ($showfilters) {
$filters = new block_contents();
$filters->content = $renderer->event_filter();
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