Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-27164 groups Do not show multiple instances of the same role as m…

…ultiple
  • Loading branch information...
commit 53c07f1644511b9a6c151f1f5f413f04f0f77bb5 1 parent 9b7b6fa
Michael Aherne micaherne authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 group/lib.php
5 group/lib.php
View
@@ -846,7 +846,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();
@@ -876,7 +876,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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.