From 35d841158533a2d9ca168bb5fc9d7b2b7d950617 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 24 Mar 2021 16:36:01 -0600 Subject: [PATCH] Calendar: Fix could not delete alarms in unsaved copy of an event --- calendar/inc/class.calendar_uiforms.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index bb7544195d..80e8668178 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -706,10 +706,14 @@ class calendar_uiforms extends calendar_ui // Copy alarms if (is_array($event['alarm'])) { - foreach($event['alarm'] as $n => &$alarm) + $alarm_index = 0; + $alarms = $event['alarm']; + $event['alarm'] = Array(); + foreach($alarms as $n => $alarm) { - unset($alarm['id']); unset($alarm['cal_id']); + $alarm['id'] = $alarm_index++; + $event['alarm'][] = $alarm; } }