Skip to content

Commit

Permalink
MDL-59393 calendar: remove use of legacy event in event_exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Aug 23, 2017
1 parent 909d085 commit 28e030d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions calendar/classes/external/event_exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,9 @@ protected function get_other_values(renderer_base $output) {
}
}

if ($legacyevent->groupid) {
if ($group = calendar_get_group_cached($legacyevent->groupid)) {
$values['groupname'] = format_string($group->name, true,
['context' => \context_course::instance($group->courseid)]);
} else {
$values['groupname'] = null;
}
if ($group = $event->get_group()) {
$values['groupname'] = format_string($group->get('name'), true,
['context' => \context_course::instance($event->get_course()->get('id'))]);
}

return $values;
Expand Down

0 comments on commit 28e030d

Please sign in to comment.