Skip to content

Commit

Permalink
MDL-41590 Enrolments: If course is deleted, then use courseid for ref…
Browse files Browse the repository at this point in the history
…erence
  • Loading branch information
Rajesh Taneja committed Sep 4, 2013
1 parent ee78814 commit b7a5eb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion enrol/meta/lib.php
Expand Up @@ -46,7 +46,12 @@ public function get_instance_name($instance) {
} else if (empty($instance->name)) {
$enrol = $this->get_name();
$course = $DB->get_record('course', array('id'=>$instance->customint1));
$coursename = format_string(get_course_display_name_for_list($course));
if ($course) {
$coursename = format_string(get_course_display_name_for_list($course));
} else {
// Use course id, if course is deleted.
$coursename = $instance->customint1;
}
return get_string('pluginname', 'enrol_' . $enrol) . ' (' . $coursename . ')';
} else {
return format_string($instance->name);
Expand Down

0 comments on commit b7a5eb1

Please sign in to comment.