[BUGFIX] Respect config.debug setting for displaying parsetime 09/28909/3
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 27 Mar 2014 12:20:11 +0000 (13:20 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 30 Mar 2014 15:45:33 +0000 (17:45 +0200)
2 possible information snippets can be outputted using
config.debug = 1 in TypoScript or [FE][debug]=1 in Install Tool.

- Parsetime
- Cached page generated time + expire date

TypoScript should override the general setting of the Install Tool
to make it possible to turn debugging of for specific PAGE objects.

This is especially needed if using e.g JSON output is invalid
having this information.

The change uses the same check as in index_ts where it works perfectly
fine.

Change-Id: I1520896476d97286627ab7f3b232b733dd3c50f7
Resolves: #57365
Releases: 6.2
Reviewed-on: https://review.typo3.org/28909
Reviewed-by: Helmut Hummel
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index a6542c3..269cec9 100644 (file)
@@ -2205,7 +2205,13 @@ class TypoScriptFrontendController {
                                        // Setting flag, so we know, that some cached content has been loaded
                                        $this->cacheContentFlag = 1;
                                        $this->cacheExpires = $row['expires'];
-                                       if ($this->TYPO3_CONF_VARS['FE']['debug'] || isset($this->config['config']['debug']) && $this->config['config']['debug']) {
+
+                                       if (isset($this->config['config']['debug'])) {
+                                               $debugCacheTime = (bool)$this->config['config']['debug'];
+                                       } else {
+                                               $debugCacheTime = !empty($this->TYPO3_CONF_VARS['FE']['debug']);
+                                       }
+                                       if ($debugCacheTime) {
                                                $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
                                                $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
                                                $this->content .= LF . '<!-- Cached page generated ' . date(($dateFormat . ' ' . $timeFormat), $row['tstamp']) . '. Expires ' . Date(($dateFormat . ' ' . $timeFormat), $row['expires']) . ' -->';