mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-42514 groups: Importing groups created unnamed groupings
This commit is contained in:
parent
33c4c3a363
commit
40bbce2499
@ -196,16 +196,16 @@ if ($mform_post->is_cancelled()) {
|
||||
}
|
||||
|
||||
// Add group to grouping
|
||||
if (isset($newgroup->groupingname)) {
|
||||
if (!empty($newgroup->groupingname) || is_numeric($newgroup->groupingname)) {
|
||||
$groupingname = $newgroup->groupingname;
|
||||
if (! $groupingid = groups_get_grouping_by_name($newgroup->courseid, $groupingname)) {
|
||||
$data = new stdClass();
|
||||
$data->courseid = $newgroup->courseid;
|
||||
$data->name = $groupingname;
|
||||
if ($groupingid = groups_create_grouping($data)) {
|
||||
echo $OUTPUT->notification(get_string('groupingaddedsuccesfully', 'group', $groupname), 'notifysuccess');
|
||||
echo $OUTPUT->notification(get_string('groupingaddedsuccesfully', 'group', $groupingname), 'notifysuccess');
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('groupingnotaddederror', 'error', $groupname));
|
||||
echo $OUTPUT->notification(get_string('groupingnotaddederror', 'error', $groupingname));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user