Permalink
Browse files

MDL-41590 Enrolments: If course is deleted, then use courseid for ref…

…erence
  • Loading branch information...
Rajesh Taneja Sam Hemelryk
Rajesh Taneja authored and Sam Hemelryk committed Sep 4, 2013
1 parent 05f840e commit b7e603a70c40d60b1d0851d42e1f7498e186730d
Showing with 6 additions and 1 deletion.
  1. +6 −1 enrol/meta/lib.php
View
@@ -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);

0 comments on commit b7e603a

Please sign in to comment.