MDL-17724 fixed group/grouping renaming now allows case change; backported from HEAD

This commit is contained in:
skodak
2008-12-29 21:32:36 +00:00
parent ea0bc86d6e
commit c3e7bda77c
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -47,9 +47,11 @@ class group_form extends moodleform {
$errors = parent::validation($data, $files);
$textlib = textlib_get_instance();
$name = trim(stripslashes($data['name']));
if ($data['id'] and $group = get_record('groups', '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);
}
+3 -1
View File
@@ -32,9 +32,11 @@ class grouping_form extends moodleform {
$errors = parent::validation($data, $files);
$textlib = textlib_get_instance();
$name = trim(stripslashes($data['name']));
if ($data['id'] and $grouping = get_record('groupings', '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);
}