Skip to content
Browse files

Merge branch 'wip-mdl-31894-m21' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_21_STABLE
  • Loading branch information...
2 parents 15c49dc + 7d01921 commit 87ab86d1cb141e84c5b5d9824d7505ec59e51252 @stronk7 stronk7 committed Mar 7, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 blocks/participants/block_participants.php
View
9 blocks/participants/block_participants.php
@@ -20,7 +20,14 @@ function get_content() {
$this->content->footer = '';
// user/index.php expect course context, so get one if page has module context.
- $currentcontext = $this->page->context->get_course_context(false);
+ // Do explicit check on context as we don't want to throw any exception on context
+ // above course level.
+ $currentcontext = NULL;
+ if (($this->page->context->contextlevel == CONTEXT_COURSE) ||
+ ($this->page->context->contextlevel == CONTEXT_MODULE) ||
+ ($this->page->context->contextlevel == CONTEXT_BLOCK)) {
+ $currentcontext = get_course_context($this->page->context);
+ }
if (empty($currentcontext)) {
$this->content = '';

0 comments on commit 87ab86d

Please sign in to comment.
Something went wrong with that request. Please try again.