fix PHP 8.0 TypeError: calendar_tracking::track(): Argument #2 ($old) must be of type ?array, bool given

This commit is contained in:
Ralf Becker 2021-11-18 17:35:26 +01:00
parent f2af53e1c7
commit 4f78f557bb

View File

@ -1591,7 +1591,7 @@ class calendar_boupdate extends calendar_bo
$save_event[$ts] = $save_event[$ts]->format('ts'); $save_event[$ts] = $save_event[$ts]->format('ts');
} }
} }
$tracking->track($save_event, $old_event); $tracking->track($save_event, $old_event ?: null);
return $cal_id; return $cal_id;
} }
@ -1832,7 +1832,7 @@ class calendar_boupdate extends calendar_bo
if (($event = $this->read($cal_id, $recur_date, $ignore_acl, 'server'))) if (($event = $this->read($cal_id, $recur_date, $ignore_acl, 'server')))
{ {
$tracking = new calendar_tracking($this); $tracking = new calendar_tracking($this);
$tracking->track($event, $old_event); $tracking->track($event, $old_event ?: null);
} }
// notify the link-class about the update, as other apps may be subscribed to it // notify the link-class about the update, as other apps may be subscribed to it
Link::notify_update('calendar', $cal_id, $event, "update"); Link::notify_update('calendar', $cal_id, $event, "update");