Fix E_NOTICE for is_required in address form
authorPatrick Figel <pfigel@greenpeace.org>
Mon, 7 Oct 2019 14:48:51 +0000 (16:48 +0200)
committerPatrick Figel <pfigel@greenpeace.org>
Mon, 7 Oct 2019 14:48:51 +0000 (16:48 +0200)
This fixes an E_NOTICE that's triggered for optional address custom
fields in CRM_Contact_Form_Edit_Address.

CRM/Contact/Form/Edit/Address.php

index 8cc795e56a58641032734354de33b0050c5e6504..a155dee6e71a8068968eb8205b754df5b2f46ba3 100644 (file)
@@ -371,7 +371,7 @@ class CRM_Contact_Form_Edit_Address {
         }
 
         foreach ($csVal['fields'] as $cdId => $cdVal) {
-          if ($cdVal['is_required']) {
+          if (!empty($cdVal['is_required'])) {
             $elementName = $cdVal['element_name'];
             if (in_array($elementName, $form->_required)) {
               // store the omitted rule for a element, to be used later on