Browse files

MDL-36731 fix E_STRICt issue when creating new groups in user upload

  • Loading branch information...
1 parent 325e266 commit 15a77653e4026186e23413723c26bd4d19e6e459 @skodak skodak committed Nov 20, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/tool/uploaduser/index.php
View
6 admin/tool/uploaduser/index.php
@@ -900,7 +900,11 @@
$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');

0 comments on commit 15a7765

Please sign in to comment.