From e73923f0c54d79d1e7eda24bf4794691e70c39f4 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 05d0f453f7..fde5445c5d 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1543,7 +1543,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) { @@ -1938,7 +1938,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; } }