MDL-33770 webservices: Fixed error with core_group_create_groups when no enrolment...
authorSam Hemelryk <sam@moodle.com>
Wed, 4 Jul 2012 21:22:12 +0000 (09:22 +1200)
committerSam Hemelryk <sam@moodle.com>
Wed, 4 Jul 2012 21:22:35 +0000 (09:22 +1200)
group/externallib.php

index 79d1a27..39db087 100644 (file)
@@ -105,6 +105,9 @@ class core_group_external extends external_api {
 
             // finally create the group
             $group->id = groups_create_group($group, false);
+            if (!isset($group->enrolmentkey)) {
+                $group->enrolmentkey = '';
+            }
             $groups[] = (array)$group;
         }