Permalink
Browse files

Merge branch 'MDL-27164-MOODLE_23_STABLE' of git://github.com/micaher…

…ne/moodle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 6042f30 + 5a701d1 commit 166cb23ea4714df0716432b481c372a66d8ff986 @danpoltawski danpoltawski committed Jan 22, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 group/lib.php
View
@@ -772,7 +772,7 @@ function groups_calculate_role_people($rs, $context) {
$roles[$roledata->id] = $roledata;
}
// Record that user has role
- $users[$rec->userid]->roles[] = $roles[$rec->roleid];
+ $users[$rec->userid]->roles[$rec->roleid] = $roles[$rec->roleid];
}
}
$rs->close();
@@ -802,7 +802,8 @@ function groups_calculate_role_people($rs, $context) {
} else if($rolecount > 1) {
$roleid = '*';
} else {
- $roleid = $userdata->roles[0]->id;
+ $userrole = reset($userdata->roles);
+ $roleid = $userrole->id;
}
$roles[$roleid]->users[$userid] = $userdata;
}

0 comments on commit 166cb23

Please sign in to comment.