mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'wip-mdl-41590' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
79257da228
1 changed files with 6 additions and 1 deletions
|
@ -46,7 +46,12 @@ class enrol_meta_plugin extends enrol_plugin {
|
||||||
} else if (empty($instance->name)) {
|
} else if (empty($instance->name)) {
|
||||||
$enrol = $this->get_name();
|
$enrol = $this->get_name();
|
||||||
$course = $DB->get_record('course', array('id'=>$instance->customint1));
|
$course = $DB->get_record('course', array('id'=>$instance->customint1));
|
||||||
|
if ($course) {
|
||||||
$coursename = format_string(get_course_display_name_for_list($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 . ')';
|
return get_string('pluginname', 'enrol_' . $enrol) . ' (' . $coursename . ')';
|
||||||
} else {
|
} else {
|
||||||
return format_string($instance->name);
|
return format_string($instance->name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue