From 66cf807cddade32960dd87964d29aba18ed3e282 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 5 Oct 2021 16:35:27 +0200 Subject: [PATCH] fix PHP 8.0 Error: Argument #2 ($array) must be of type array, null given --- addressbook/inc/class.addressbook_ui.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 242d13eaf6..b54dd808e3 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -1736,9 +1736,13 @@ class addressbook_ui extends addressbook_bo if (isset($this->grouped_views[(string) $query['grouped_view']])) { // we have a grouped view, reset the advanced search - if(!$query['search'] && $old_state['advanced_search']) $query['advanced_search'] = $old_state['advanced_search']; + if (empty($query['search']) && !empty($old_state['advanced_search'])) + { + $query['advanced_search'] = $old_state['advanced_search']; + } } - elseif(!$query['search'] && array_key_exists('advanced_search',$old_state)) // eg. paging in an advanced search + // eg. paging in an advanced search + elseif(empty($query['search']) && is_array($old_state) && array_key_exists('advanced_search', $old_state)) { $query['advanced_search'] = $old_state['advanced_search']; }