mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-17724 fixed group/grouping renaming now allows case change
This commit is contained in:
parent
920337d1d0
commit
9e1bb31035
@ -46,9 +46,11 @@ class group_form extends moodleform {
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
|
||||
$textlib = textlib_get_instance();
|
||||
|
||||
$name = trim($data['name']);
|
||||
if ($data['id'] and $group = $DB->get_record('groups', array('id'=>$data['id']))) {
|
||||
if ($group->name != $name) {
|
||||
if ($textlib->strtolower($group->name) != $textlib->strtolower($name)) {
|
||||
if (groups_get_group_by_name($COURSE->id, $name)) {
|
||||
$errors['name'] = get_string('groupnameexists', 'group', $name);
|
||||
}
|
||||
|
@ -32,9 +32,11 @@ class grouping_form extends moodleform {
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
|
||||
$textlib = textlib_get_instance();
|
||||
|
||||
$name = trim($data['name']);
|
||||
if ($data['id'] and $grouping = $DB->get_record('groupings', array('id'=>$data['id']))) {
|
||||
if ($grouping->name != $name) {
|
||||
if ($textlib->strtolower($grouping->name) != $textlib->strtolower($name)) {
|
||||
if (groups_get_grouping_by_name($COURSE->id, $name)) {
|
||||
$errors['name'] = get_string('groupingnameexists', 'group', $name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user