MDL-81349 group: case-sensitive name validation when editing.

This commit is contained in:
Paul Holden
2024-07-01 09:41:43 +01:00
parent 87d7ac1f81
commit 75b3607fc3
+2 -2
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);
}