From 42d45131e61e5308b097a5d3b5de20e42e015c14 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Nov 2021 13:52:20 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: Unsupported operand types: EGroupware\Api\DateTime - int --- calendar/inc/class.calendar_boupdate.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index b64b0cd269..0b7280c873 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1550,7 +1550,7 @@ class calendar_boupdate extends calendar_bo $event['created'] = $save_event['created'] = $this->now; $event['creator'] = $save_event['creator'] = $this->user; } - $set_recurrences = $old_event ? abs($event['recur_enddate'] - $old_event['recur_enddate']) > 1 : false; + $set_recurrences = $old_event ? abs(Api\DateTime::to($event['recur_enddate'], 'utc') - Api\DateTime::to($old_event['recur_enddate'], 'utc')) > 1 : false; $set_recurrences_start = 0; if (($cal_id = $this->so->save($event,$set_recurrences,$set_recurrences_start,0,$event['etag'])) && $set_recurrences && $event['recur_type'] != MCAL_RECUR_NONE) { @@ -1945,7 +1945,8 @@ class calendar_boupdate extends calendar_bo if (!($exception = $this->read($id))) continue; $exception['uid'] = Api\CalDAV::generate_uid('calendar', $id); $exception['reference'] = $exception['recurrence'] = 0; - $this->update($exception, true, true, false, true, $msg=null, true); + $msg = null; + $this->update($exception, true, true, false, true, $msg, true); ++$exceptions_kept; } }