Skip to content

Commit

Permalink
MDL-68867 calendar: remove dependency on USER->groupmember hack
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Jun 21, 2022
1 parent b81fb00 commit 24cd968
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2158,11 +2158,7 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false, s
} else if ($isvaliduser) {
$groupids = array();
foreach ($courseeventsfrom as $courseid => $course) {
// If the user is an editing teacher in there.
if (!empty($user->groupmember[$course->id])) {
// We've already cached the users groups for this course so we can just use that.
$groupids = array_merge($groupids, $user->groupmember[$course->id]);
} else if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) {
// If this course has groups, show events from all of those related to the current user.
$coursegroups = groups_get_user_groups($course->id, $user->id);
$groupids = array_merge($groupids, $coursegroups['0']);
Expand Down

0 comments on commit 24cd968

Please sign in to comment.