From 0f17b8403010b45159e434d4c608574830a12782 Mon Sep 17 00:00:00 2001 From: John Kingsnorth Date: Thu, 20 Oct 2022 10:18:46 +0100 Subject: [PATCH] Fix PHP 8 deprecated function notices --- CRM/Core/BAO/CustomField.php | 2 +- CRM/Event/Page/ManageEvent.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index b53aae85b8..9b03aef76d 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1344,7 +1344,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { } //set defaults if mode is registration - if (!trim($value) && + if (!trim($value ?? '') && ($value !== 0) && (!in_array($mode, [CRM_Profile_Form::MODE_EDIT, CRM_Profile_Form::MODE_SEARCH])) ) { diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 57a620ec1b..bdcf956e25 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -282,7 +282,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { $this ); $createdId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0); - if (strtolower($this->_sortByCharacter) == 'all' || + if ((!empty($this->_sortByCharacter) && strtolower($this->_sortByCharacter) == 'all') || !empty($_POST) ) { $this->_sortByCharacter = ''; -- 2.25.1