From 203b990fb0fa17ad54af9270224c07606bf302aa Mon Sep 17 00:00:00 2001 From: mchurch Date: Wed, 30 Jan 2008 16:38:03 +0000 Subject: [PATCH] MDL-13252 Fix context to always use course context, rather than instance->page. --- blocks/participants/block_participants.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }