From 44e4605bdc767cfb5ddc1ae73dbd1385ebc07e3a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 21 Mar 2022 10:04:08 +1300 Subject: [PATCH] Enotice fixes civicrm/admin/uf/group/add?action=add&reset=1 --- CRM/Core/Form/EntityFormTrait.php | 10 ++++++++++ templates/CRM/Core/Form/Field.tpl | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CRM/Core/Form/EntityFormTrait.php b/CRM/Core/Form/EntityFormTrait.php index d807c58527..ccf5522788 100644 --- a/CRM/Core/Form/EntityFormTrait.php +++ b/CRM/Core/Form/EntityFormTrait.php @@ -137,6 +137,16 @@ trait CRM_Core_Form_EntityFormTrait { } $this->applyFilter('__ALL__', 'trim'); $this->addEntityFieldsToTemplate(); + foreach ($this->entityFields as $index => $fields) { + $this->entityFields[$index] = array_merge([ + 'template' => '', + 'help' => [], + 'pre_html_text' => '', + 'post_html_text' => '', + 'description' => '', + 'documentation_link' => '', + ], $fields); + } $this->assign('entityFields', $this->entityFields); $this->assign('entityID', $this->getEntityId()); $this->assign('entityInClassFormat', strtolower(str_replace('_', '-', $this->getDefaultEntity()))); diff --git a/templates/CRM/Core/Form/Field.tpl b/templates/CRM/Core/Form/Field.tpl index d6d99d35e1..b2d5ba396b 100644 --- a/templates/CRM/Core/Form/Field.tpl +++ b/templates/CRM/Core/Form/Field.tpl @@ -11,10 +11,7 @@ {include file=$fieldSpec.template} {else} {$form.$fieldName.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} + {if !empty($fieldSpec.help|smarty:nodefaults)}{assign var=help value=$fieldSpec.help}{help id=$help.id file=$help.file}{/if} {if $action == 2 && !empty($fieldSpec.is_add_translate_dialog)}{include file='CRM/Core/I18n/Dialog.tpl' table=$entityTable field=$fieldName id=$entityID}{/if} {if !empty($fieldSpec.pre_html_text)}{$fieldSpec.pre_html_text}{/if}{if $form.$fieldName.html}{$form.$fieldName.html}{else}{$fieldSpec.place_holder}{/if}{if !empty($fieldSpec.post_html_text)}{$fieldSpec.post_html_text}{/if}
-- 2.25.1