Follow up PR for #16845 - Fix form error when variable is NULL
authorJitendra Purohit <jitendra@fuzion.co.nz>
Wed, 1 Apr 2020 10:50:08 +0000 (16:20 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Wed, 1 Apr 2020 10:50:08 +0000 (16:20 +0530)
CRM/Core/Form.php

index c37dd4735301bab94e790ebb5db7c25054bd322f..1ab3ccc8764006c25b06e0260421eefc8fb5b8fd 100644 (file)
@@ -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)) {