From 2f02e550d3cf44ca36d6b8f64ec31373fd20afef Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 12 Dec 2013 09:04:16 +0100 Subject: [PATCH] MDL-40436 block_course_list: Fix bad context resolution We were trying to get the course context of a remote course from a completely unrelated ID. It would sometimes work if the ID was matching the one of a local course. In other places we are not trying to find a context for the remote course, we simply use the $PAGE context in format_string. So the usage of the context has been removed here too. --- blocks/course_list/block_course_list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php index 880ced14adc..2a82739daf4 100644 --- a/blocks/course_list/block_course_list.php +++ b/blocks/course_list/block_course_list.php @@ -128,8 +128,7 @@ class block_course_list extends block_list { $this->content->items[] = get_string('remotecourses','mnet'); $this->content->icons[] = ''; foreach ($courses as $course) { - $coursecontext = context_course::instance($course->id); - $this->content->items[]="shortname, true, array('context' => $coursecontext)) . "\" ". + $this->content->items[]="shortname, true) . "\" ". "href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}\">" .$icon. format_string($course->fullname) . ""; }