diff --git a/blocks/participants/block_participants.php b/blocks/participants/block_participants.php index 98f981f0877..215ac730c6d 100644 --- a/blocks/participants/block_participants.php +++ b/blocks/participants/block_participants.php @@ -8,7 +8,7 @@ class block_participants extends block_list { function get_content() { - global $CFG; + global $CFG, $COURSE; if (empty($this->instance)) { $this->content = ''; @@ -20,7 +20,8 @@ class block_participants extends block_list { return ''; } - if (!$currentcontext = get_context_instance(CONTEXT_COURSE, $this->instance->pageid)) { + /// MDL-13252 Always get the course context or else the context may be incorrect in the user/index.php + if (!$currentcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id)) { $this->content = ''; return $this->content; }