Merge branch 'w49_MDL-36731_m23_uploadestrict' of git://github.com/skodak/moodle into MOODLE_23_STABLE

This commit is contained in:
Sam Hemelryk 2012-12-11 16:04:13 +13:00
commit b54470f497

View file

@ -900,7 +900,11 @@ if ($formdata = $mform2->is_cancelled()) {
$newgroupdata = new stdClass();
$newgroupdata->name = $addgroup;
$newgroupdata->courseid = $ccache[$shortname]->id;
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
$newgroupdata->description = '';
$gid = groups_create_group($newgroupdata);
if ($gid){
$ccache[$shortname]->groups[$addgroup] = new stdClass();
$ccache[$shortname]->groups[$addgroup]->id = $gid;
$ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
} else {
$upt->track('enrolments', get_string('unknowngroup', 'error', s($addgroup)), 'error');