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 5a701d1fbe0ec4f1c2ceb6cb38ccc26fa709f324 1 parent 0eda863
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
@@ -767,7 +767,7 @@ function groups_calculate_role_people($rs, $context) {
767 767 $roles[$roledata->id] = $roledata;
768 768 }
769 769 // Record that user has role
770   - $users[$rec->userid]->roles[] = $roles[$rec->roleid];
  770 + $users[$rec->userid]->roles[$rec->roleid] = $roles[$rec->roleid];
771 771 }
772 772 }
773 773 $rs->close();
@@ -797,7 +797,8 @@ function groups_calculate_role_people($rs, $context) {
797 797 } else if($rolecount > 1) {
798 798 $roleid = '*';
799 799 } else {
800   - $roleid = $userdata->roles[0]->id;
  800 + $userrole = reset($userdata->roles);
  801 + $roleid = $userrole->id;
801 802 }
802 803 $roles[$roleid]->users[$userid] = $userdata;
803 804 }

0 comments on commit 5a701d1

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