Notice fixes in advanced search
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 16 Mar 2022 21:59:56 +0000 (10:59 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 16 Mar 2022 21:59:56 +0000 (10:59 +1300)
CRM/Contact/Form/Search/Criteria.php
templates/CRM/Contact/Form/Search/Criteria/Basic.tpl

index bbebe40d736683050b4ffa26b2f0374408ea7912..7ebaa89e9002dba07154e155fc10ef37da66cc6e 100644 (file)
@@ -55,6 +55,10 @@ class CRM_Contact_Form_Search_Criteria {
       }
     }
 
+    // Suppress e-notices for tag fields if not set...
+    $form->addOptionalQuickFormElement('tag_types_text');
+    $form->addOptionalQuickFormElement('tag_set');
+    $form->addOptionalQuickFormElement('all_tag_types');
     if ($form->_searchOptions['tags']) {
       // multiselect for categories
       $contactTags = CRM_Core_BAO_Tag::getTags();
@@ -82,7 +86,7 @@ class CRM_Contact_Form_Search_Criteria {
           $showAllTagTypes = TRUE;
         }
       }
-      $tagTypesText = implode(" or ", $tagsTypes);
+      $tagTypesText = implode(' or ', $tagsTypes);
       if ($showAllTagTypes) {
         $form->add('checkbox', 'all_tag_types', ts('Include tags used for %1', [1 => $tagTypesText]));
         $form->add('hidden', 'tag_types_text', $tagTypesText);
index 2f605153cd275a4d45ddead2b46371150eb89b5d..8b93dbbfc74bcacedad10d5996adcfa762a15d95 100644 (file)
@@ -18,7 +18,6 @@
           {$field.label}
           {if !empty($fieldSpec.help)}
             {assign var=help value=$fieldSpec.help}
-            {capture assign=helpFile}{if $fieldSpec.help}{$fieldSpec.help}{else}''{/if}{/capture}
             {help id=$help.id file=$help.file}
           {/if}
           <br />