Update debug.tpl to not be noticey with Smarty3
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 22 Sep 2023 22:35:00 +0000 (10:35 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 22 Sep 2023 22:45:29 +0000 (10:45 +1200)
CRM/Core/Smarty.php
templates/CRM/common/debug.tpl

index b5c22c62df572f335de727f87beffb481f90e4d3..af9f6536b3d2079a00aebcc56d196100527442a6 100644 (file)
@@ -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);
index 32d69257e487ea7535281bb7b46430af66613e1e..416c4b47e4b7733f7b5193843c9194847c232380 100644 (file)
@@ -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}