Skip to content

Commit

Permalink
MDL-42047 fix cohort method name error after deleting cohort
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 4, 2013
1 parent 56cc9b3 commit 4839160
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions enrol/cohort/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function get_instance_name($instance) {
} else if (empty($instance->name)) {
$enrol = $this->get_name();
$cohort = $DB->get_record('cohort', array('id'=>$instance->customint1));
if (!$cohort) {
return get_string('pluginname', 'enrol_'.$enrol);
}
$cohortname = format_string($cohort->name, true, array('context'=>context::instance_by_id($cohort->contextid)));
if ($role = $DB->get_record('role', array('id'=>$instance->roleid))) {
$role = role_get_name($role, context_course::instance($instance->courseid, IGNORE_MISSING));
Expand Down

0 comments on commit 4839160

Please sign in to comment.