Skip to content

Commit

Permalink
MDL-40436 block_course_list: Fix bad context resolution
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FMCorz committed Dec 12, 2013
1 parent c36a240 commit 6785030
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions blocks/course_list/block_course_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ function get_remote_courses() {
$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}&amp;wantsurl=/course/view.php?id={$course->remoteid}\">"
.$icon. format_string(get_course_display_name_for_list($course)) . "</a>";
}
Expand Down

0 comments on commit 6785030

Please sign in to comment.