Merge branch 'MDL-81349-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE

This commit is contained in:
Sara Arjona 2024-07-09 18:14:44 +02:00
commit e1816e9af1
No known key found for this signature in database

View File

@ -180,8 +180,8 @@ class group_form extends moodleform {
} else {
$idnumber = '';
}
if ($data['id'] and $group = $DB->get_record('groups', array('id'=>$data['id']))) {
if (core_text::strtolower($group->name) != core_text::strtolower($name)) {
if ($data['id'] && $group = $DB->get_record('groups', ['id' => $data['id']])) {
if ($group->name != $name) {
if (groups_get_group_by_name($COURSE->id, $name)) {
$errors['name'] = get_string('groupnameexists', 'group', $name);
}