From 470fd6219b36afaa94896b4a37b38694e04e52ef Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 22 Aug 2022 11:19:09 +1200 Subject: [PATCH] Fix Advanced search under strict smarty --- CRM/Contact/Form/Search/Criteria.php | 6 +++++- templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 7ebaa89e9002..1dda83c0cd0e 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -315,7 +315,11 @@ protected static function setBasicSearchFields($form) { foreach (self::getFilteredSearchFieldMetadata('basic') as $fieldName => $field) { $searchFields[$fieldName] = $field; } - $form->assign('basicSearchFields', array_merge(self::getBasicSearchFields(), $searchFields)); + $fields = array_merge(self::getBasicSearchFields(), $searchFields); + foreach ($fields as $index => $field) { + $fields[$index] = array_merge(['class' => '', 'is_custom' => FALSE, 'template' => '', 'help' => '', 'description' => ''], $field); + } + $form->assign('basicSearchFields', $fields); } /** diff --git a/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl b/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl index 3dbdecafc373..b213089691fc 100644 --- a/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl +++ b/templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl @@ -40,7 +40,7 @@ CRM.$(function($) { return false; }); // TODO: Why are the modes numeric? If they used the string there would be no need for this map - var modes = {/literal}{$component_mappings}{literal}; + var modes = {/literal}{$component_mappings|smarty:nodefaults}{literal}; // Handle change of results mode $('#component_mode').change(function() { // Reset task dropdown @@ -111,7 +111,7 @@ CRM.$(function($) { {foreach from=$allPanes key=paneName item=paneValue} -
+
{$paneName}