From 234e0133475dc64aa3e7bf725e4ae5b4a0097932 Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 22 Nov 2018 11:35:35 -0700 Subject: [PATCH] * Calendar - fix alarm removed if user is only participant because of group invitation --- calendar/inc/class.calendar_boupdate.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index e3594d0eff..7defb1b899 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1326,12 +1326,15 @@ class calendar_boupdate extends calendar_bo // same with the alarms if (isset($event['alarm']) && is_array($event['alarm']) && isset($event['start'])) { + // Expand group invitations so we don't lose individual alarms + $expanded = $event; + $this->enum_groups($expanded); foreach($event['alarm'] as $id => &$alarm) { // remove alarms belonging to not longer existing or rejected participants - if ($alarm['owner'] && isset($event['participants'])) + if ($alarm['owner'] && isset($expanded['participants'])) { - $status = $event['participants'][$alarm['owner']]; + $status = $expanded['participants'][$alarm['owner']]; if (!isset($status) || calendar_so::split_status($status) === 'R') { unset($event['alarm'][$id]);