Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 15a77653e4026186e23413723c26bd4d19e6e459 1 parent 325e266
@skodak skodak authored
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');
Please sign in to comment.
Something went wrong with that request. Please try again.