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.
This commit is contained in:
@@ -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[]="<a title=\"" . format_string($course->shortname, true, array('context' => $coursecontext)) . "\" ".
|
||||
$this->content->items[]="<a title=\"" . format_string($course->shortname, true) . "\" ".
|
||||
"href=\"{$CFG->wwwroot}/auth/mnet/jump.php?hostid={$course->hostid}&wantsurl=/course/view.php?id={$course->remoteid}\">"
|
||||
.$icon. format_string($course->fullname) . "</a>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user