From: Eileen McNaughton Date: Wed, 16 Mar 2022 21:59:56 +0000 (+1300) Subject: Notice fixes in advanced search X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d6ac32de0076f4defa8f10649d6396fdbe5da675;p=civicrm-core.git Notice fixes in advanced search --- diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index bbebe40d73..7ebaa89e90 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -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); diff --git a/templates/CRM/Contact/Form/Search/Criteria/Basic.tpl b/templates/CRM/Contact/Form/Search/Criteria/Basic.tpl index 2f605153cd..8b93dbbfc7 100644 --- a/templates/CRM/Contact/Form/Search/Criteria/Basic.tpl +++ b/templates/CRM/Contact/Form/Search/Criteria/Basic.tpl @@ -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}