From e909fda3bb5eb5c1ab5632c8e75619a094804901 Mon Sep 17 00:00:00 2001 From: Noah Miller Date: Thu, 16 Mar 2023 23:20:27 -0400 Subject: [PATCH] avoid type error in CRM_Core_Form on php 8 --- CRM/Case/Form/Case.php | 2 +- CRM/Core/Form.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index 76800a4358..da3c6cda7b 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -198,7 +198,7 @@ class CRM_Case_Form_Case extends CRM_Core_Form { /** * Set default values for the form. */ - public function setDefaultValues() { + public function setDefaultValues(): array { if ($this->_action & CRM_Core_Action::DELETE || $this->_action & CRM_Core_Action::RENEW) { return []; } diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index c3682d97b4..032c89b8d9 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -694,7 +694,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->buildQuickForm(); $defaults = $this->setDefaultValues(); - unset($defaults['qfKey']); + if (isset($defaults['qfKey'])) { + unset($defaults['qfKey']); + } if (!empty($defaults)) { $this->setDefaults($defaults); -- 2.25.1