]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17724 fixed group/grouping renaming now allows case change
authorskodak <skodak>
Mon, 29 Dec 2008 21:32:20 +0000 (21:32 +0000)
committerskodak <skodak>
Mon, 29 Dec 2008 21:32:20 +0000 (21:32 +0000)
group/group_form.php
group/grouping_form.php

index cded5d9f54c36aa00f106e1c6b94de3baf66d565..95fbe17f8bdce65425fd7751b18a0ae6854616be 100644 (file)
@@ -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);
                 }
index 9f4fe66a52c5509ca552ea45dba2215aa429d1b8..c63b2d4316387acab0f349f758a7948d957e2dbd 100644 (file)
@@ -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);
                 }