Skip to content
Browse files

Fix when storing group memberships in USER session

  • Loading branch information...
1 parent 38a8fdd commit 3facf28fe1ac3c1a61d9b6bb77c4e7b1efdbee66 moodler committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/datalib.php
View
6 lib/datalib.php
@@ -946,9 +946,9 @@ function get_user_info_from_db($field, $value) {
}
if ($groups = get_records("groups_members", "userid", $user->id)) {
- foreach ($groups as $group) {
- $courseid = get_field("groups", "courseid", "id", $group->id);
- $user->groupmember[$courseid] = $group->id;
+ foreach ($groups as $groupmember) {
+ $courseid = get_field("groups", "courseid", "id", $groupmember->groupid);
+ $user->groupmember[$courseid] = $groupmember->groupid;
}
}

0 comments on commit 3facf28

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