From fcce3cedcc126665c909d6abaafe203afe9efffb Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 1 Apr 2020 16:20:08 +0530 Subject: [PATCH] Follow up PR for #16845 - Fix form error when variable is NULL --- CRM/Core/Form.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index c37dd47353..1ab3ccc876 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -413,8 +413,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } } } - $optionContext = $extra['option_context'] ?? NULL; - unset($extra['option_context']); + $optionContext = NULL; + if (!empty($extra['option_context'])) { + $optionContext = $extra['option_context']; + unset($extra['option_context']); + } $element = $this->addElement($type, $name, $label, $attributes, $extra); if (HTML_QuickForm::isError($element)) { -- 2.25.1