MDL-59368 groups: Show no groups instead of ''
[moodle.git] / group / classes / output / user_groups_editable.php
index 17c99bd..12c8c57 100644 (file)
@@ -92,7 +92,11 @@ class user_groups_editable extends \core\output\inplace_editable {
             $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);
     }