Skip to content

Commit

Permalink
MDL-59368 groups: Show no groups instead of ''
Browse files Browse the repository at this point in the history
This is on the inplace editable for a users course groups.
  • Loading branch information
Damyon Wiese committed Jul 12, 2017
1 parent 76c493b commit 4aad7c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion group/classes/output/user_groups_editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ public function export_for_template(\renderer_base $output) {
$listofgroups[] = format_string($this->coursegroups[$id]->name, true, ['context' => $this->context]);
}

$this->displayvalue = implode($listofgroups, ', ');
if (!empty($listofgroups)) {
$this->displayvalue = implode($listofgroups, ', ');
} else {
$this->displayvalue = get_string('groupsnone');
}
return parent::export_for_template($output);
}

Expand Down

0 comments on commit 4aad7c2

Please sign in to comment.