From 5b0558e89c9f89576a07e697e0fe6c6bf6270257 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 23 Sep 2023 10:35:00 +1200 Subject: [PATCH] Update debug.tpl to not be noticey with Smarty3 --- CRM/Core/Smarty.php | 8 ++++++++ templates/CRM/common/debug.tpl | 18 +++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index b5c22c62df..af9f6536b3 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -132,6 +132,14 @@ class CRM_Core_Smarty extends Smarty { $this->assign('config', $config); $this->assign('session', $session); + $this->assign('debugging', [ + 'smartyDebug' => CRM_Utils_Request::retrieveValue('smartyDebug', NULL, FALSE, FALSE, $_GET), + 'sessionReset' => CRM_Utils_Request::retrieveValue('sessionReset', NULL, FALSE, FALSE, $_GET), + 'sessionDebug' => CRM_Utils_Request::retrieveValue('sessionDebug', NULL, FALSE, FALSE, $_GET), + 'directoryCleanup' => CRM_Utils_Request::retrieveValue('directoryCleanup', NULL, FALSE, FALSE, $_GET), + 'cacheCleanup' => CRM_Utils_Request::retrieveValue('cacheCleanup', NULL, FALSE, FALSE, $_GET), + 'configReset' => CRM_Utils_Request::retrieveValue('configReset', NULL, FALSE, FALSE, $_GET), + ]); $tsLocale = CRM_Core_I18n::getLocale(); $this->assign('tsLocale', $tsLocale); diff --git a/templates/CRM/common/debug.tpl b/templates/CRM/common/debug.tpl index 32d69257e4..416c4b47e4 100644 --- a/templates/CRM/common/debug.tpl +++ b/templates/CRM/common/debug.tpl @@ -8,26 +8,26 @@ +--------------------------------------------------------------------+ *} -{if isset($smarty.get.smartyDebug|smarty:nodefaults)} +{if $debugging.smartyDebug} {debug} {/if} -{if isset($smarty.get.sessionReset|smarty:nodefaults)} -{$session->reset($smarty.get.sessionReset)} +{if $debugging.sessionReset} +{$session->reset($debugging.sessionReset)} {/if} -{if isset($smarty.get.sessionDebug|smarty:nodefaults)} -{$session->debug($smarty.get.sessionDebug)} +{if $debugging.sessionDebug} +{$session->debug($debugging.sessionDebug)} {/if} -{if isset($smarty.get.directoryCleanup|smarty:nodefaults)} -{$config->cleanup($smarty.get.directoryCleanup)} +{if $debugging.directoryCleanup} +{$config->cleanup($debugging.directoryCleanup)} {/if} -{if isset($smarty.get.cacheCleanup|smarty:nodefaults)} +{if $debugging.cacheCleanup} {$config->clearDBCache()} {/if} -{if isset($smarty.get.configReset|smarty:nodefaults)} +{if $debugging.configReset} {$config->reset()} {/if} -- 2.25.1