Skip to content

Commit

Permalink
Merge pull request #24336 from eileenmcnaughton/smarty_adv_search
Browse files Browse the repository at this point in the history
Fix Advanced search under strict smarty
  • Loading branch information
eileenmcnaughton authored Aug 22, 2022
2 parents 5a90d51 + 470fd62 commit cafaffb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CRM/Contact/Form/Search/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,7 +111,7 @@ CRM.$(function($) {
</div>
</div>
{foreach from=$allPanes key=paneName item=paneValue}
<div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open eq 'true' || !empty($openedPanes.$paneName)} {else}collapsed{/if}">
<div class="crm-accordion-wrapper crm-ajax-accordion crm-{$paneValue.id}-accordion {if $paneValue.open eq 'true' || array_key_exists($paneName, $openedPanes)} {else}collapsed{/if}">
<div class="crm-accordion-header" id="{$paneValue.id}">
{$paneName}
</div>
Expand Down

0 comments on commit cafaffb

Please sign in to comment.