From dba803fff51b25b08dff47454915bc1b3be99fa9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Nov 2021 10:30:57 +0100 Subject: [PATCH] fix PHP 8.0 error: count(): Argument #1 ($value) must be of type Countable|array, null given plus some more IDE "errors" --- calendar/inc/class.calendar_uiforms.inc.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 9f5359cb66..37b047e681 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -55,7 +55,7 @@ class calendar_uiforms extends calendar_ui /** * default locking time for entries, that are opened by another user * - * @var locktime in seconds + * @var int lock time in seconds */ var $locktime_default=1; @@ -262,7 +262,7 @@ class calendar_uiforms extends calendar_ui ); } - return array( + $ret = array( 'participant_types' => $participant_types, 'participants' => $participants, 'owner' => $owner, @@ -278,6 +278,7 @@ class calendar_uiforms extends calendar_ui 'videoconference' => !empty($_GET['videoconference']), '##notify_externals' => !empty($_GET['videoconference']) ? 'yes' : $this->cal_prefs['notify_externals'], ); + return $ret; } /** @@ -1872,7 +1873,7 @@ class calendar_uiforms extends calendar_ui if ($event['recur_type'] != MCAL_RECUR_NONE) { - $readonlys['recur_exception'] = !count($content['recur_exception']); // otherwise we get a delete button + $readonlys['recur_exception'] = empty($content['recur_exception']); // otherwise we get a delete button //$onclick =& $etpl->get_cell_attribute('button[delete]','onclick'); //$onclick = str_replace('Delete this event','Delete this series of recuring events',$onclick); } @@ -2843,7 +2844,7 @@ class calendar_uiforms extends calendar_ui #error_log(__METHOD__.print_r($content,true)); if (is_numeric($cal_id = $content ? $content : $_REQUEST['cal_id'])) { - if (!($ical =& $boical->exportVCal(array($cal_id),'2.0','PUBLISH',false))) + if (!($ical = $boical->exportVCal(array($cal_id),'2.0','PUBLISH',false))) { $msg = lang('Permission denied'); @@ -2872,7 +2873,7 @@ class calendar_uiforms extends calendar_ui } else { - $ical =& $boical->exportVCal($events,'2.0','PUBLISH',false); + $ical = $boical->exportVCal($events,'2.0','PUBLISH',false); Api\Header\Content::type($content['file'] ? $content['file'] : 'event.ics','text/calendar',bytes($ical)); echo $ical; exit();