From c551606242136d23f31e0ed9c7f280b6f97a8fb3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 28 Nov 2021 19:41:14 +1300 Subject: [PATCH] Enotice fixes - ensure a couple more variables are consistently assigned --- CRM/Core/Form.php | 2 ++ CRM/Core/Invoke.php | 6 ++++++ templates/CRM/common/formButtons.tpl | 2 +- templates/CRM/common/jsortable.tpl | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 9fdf2e8668..3b8da3e6fb 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -279,6 +279,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { 'infoOptions', // required for attachmentjs.tpl 'context', + // FormButtons.tpl (adds buttons to forms). + 'linkButtons', ]; /** diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 12db074dc8..48bf206c62 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -220,6 +220,12 @@ class CRM_Core_Invoke { $template = CRM_Core_Smarty::singleton(); $template->assign('activeComponent', 'CiviCRM'); $template->assign('formTpl', 'default'); + // Ensure template variables have 'something' assigned for e-notice + // prevention. These are ones that are included very often + // and not tied to a specific form. + // jsortable.tpl (datatables) + $template->assign('sourceUrl'); + $template->assign('useAjax', 0); if ($item) { diff --git a/templates/CRM/common/formButtons.tpl b/templates/CRM/common/formButtons.tpl index f00a974783..0ef85e9845 100644 --- a/templates/CRM/common/formButtons.tpl +++ b/templates/CRM/common/formButtons.tpl @@ -10,7 +10,7 @@ {crmRegion name='form-buttons'} {* Loops through $linkButtons and assigns html "a" (link) buttons to the template. Used for additional entity functions such as "Move to Case" or "Renew Membership" *} -{if !empty($linkButtons)} +{if $linkButtons} {foreach from=$linkButtons item=linkButton} {if $linkButton.accessKey} {capture assign=accessKey}accesskey="{$linkButton.accessKey}"{/capture} diff --git a/templates/CRM/common/jsortable.tpl b/templates/CRM/common/jsortable.tpl index efd1d1d13d..e33c663f80 100644 --- a/templates/CRM/common/jsortable.tpl +++ b/templates/CRM/common/jsortable.tpl @@ -27,14 +27,14 @@ } // for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget - var useAjax = {/literal}{if !empty($useAjax)}1{else}0{/if}{literal}, + var useAjax = {$useAjax}, sourceUrl = '', useClass = 'display', tcount = 1, tableId = []; if ( useAjax ) { - {/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal} + {/literal}{if $sourceUrl}sourceUrl = "{$sourceUrl}";{/if}{literal} useClass = 'pagerDisplay'; tcount = 5; } -- 2.25.1