Calendar: Fix could not delete alarms in unsaved copy of an event

This commit is contained in:
nathangray 2021-03-24 16:36:01 -06:00
parent 754261ce56
commit 35d8411585

View File

@ -706,10 +706,14 @@ class calendar_uiforms extends calendar_ui
// Copy alarms // Copy alarms
if (is_array($event['alarm'])) 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']); unset($alarm['cal_id']);
$alarm['id'] = $alarm_index++;
$event['alarm'][] = $alarm;
} }
} }