From 7ab0d0b6d2fb78e317711e0e8fe55003e5b5c77a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 21 Jan 2019 12:55:18 +0100 Subject: [PATCH] * Calendar/CalDAV: fix yearly recurring events stalling sync also fixed PHP Warning about array_intersect parameter 2 not being an array --- calendar/inc/class.calendar_groupdav.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index 559dbda008..bd391264ed 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -797,7 +797,8 @@ class calendar_groupdav extends Api\CalDAV\Handler // not for included exceptions (Lightning): $master['recur_exception'][] = $recurrence['start']; } // only add master if we are not expanding and current user participates in master (and not just some exceptions) - if (!$expand && $master && (!$user || self::isParticipant($master, $user))) + // also need to add master, if we have no (other) $events eg. birthday noone every accepted/rejected + if (!$expand && $master && (!$user || self::isParticipant($master, $user) || !$events)) { $events = array_merge(array($master), $events); } @@ -814,8 +815,9 @@ class calendar_groupdav extends Api\CalDAV\Handler public static function isParticipant(array $event, $user) { return isset($event['participants'][$user]) || - // for group-invitations we need to check memberships of $user too - array_intersect(array_keys($event['participants']), $GLOBALS['egw']->accounts->memberships($user, true)); + // for users and group-invitations we need to check memberships of $user too + $user > 0 && array_intersect(array_keys($event['participants']), + (array)$GLOBALS['egw']->accounts->memberships($user, true)); } /**