Skip to content

Commit

Permalink
Merge pull request #27582 from eileenmcnaughton/smarty_bc
Browse files Browse the repository at this point in the history
dev/core##4146 Update debug.tpl to not be noticey with Smarty3
  • Loading branch information
seamuslee001 authored Sep 28, 2023
2 parents 409e487 + 5b0558e commit 3594965
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CRM/Core/Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ private function initialize() {

$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);
Expand Down
18 changes: 9 additions & 9 deletions templates/CRM/common/debug.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
+--------------------------------------------------------------------+
*}
<!-- .tpl file invoked: {$tplFile}. Call via form.tpl if we have a form in the page. -->
{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}

0 comments on commit 3594965

Please sign in to comment.