Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 group/lib.php
5 group/lib.php
@@ -846,7 +846,7 @@ function groups_calculate_role_people($rs, $context) {
846 846 $roles[$roledata->id] = $roledata;
847 847 }
848 848 // Record that user has role
849   - $users[$rec->userid]->roles[] = $roles[$rec->roleid];
  849 + $users[$rec->userid]->roles[$rec->roleid] = $roles[$rec->roleid];
850 850 }
851 851 }
852 852 $rs->close();
@@ -876,7 +876,8 @@ function groups_calculate_role_people($rs, $context) {
876 876 } else if($rolecount > 1) {
877 877 $roleid = '*';
878 878 } else {
879   - $roleid = $userdata->roles[0]->id;
  879 + $userrole = reset($userdata->roles);
  880 + $roleid = $userrole->id;
880 881 }
881 882 $roles[$roleid]->users[$userid] = $userdata;
882 883 }

0 comments on commit 53c07f1

Please sign in to comment.
Something went wrong with that request. Please try again.