[BUGFIX] Show correct rendering times in admin panel 90/57890/4
authorSusanne Moog <susanne.moog@typo3.org>
Mon, 20 Aug 2018 16:13:33 +0000 (18:13 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 22 Aug 2018 09:00:19 +0000 (11:00 +0200)
* adds missing timetracker->push()
* removes unnecessary call to printTSlog
* reuse existing variable in fixContent, to avoid notices

Resolves: #85916
Releases: master
Change-Id: I6e7b1f8872d1f058abc93802660ba625bbcf2d24
Reviewed-on: https://review.typo3.org/57890
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/adminpanel/Classes/Modules/TsDebug/TypoScriptWaterfall.php
typo3/sysext/core/Classes/TimeTracker/TimeTracker.php
typo3/sysext/frontend/Classes/Http/RequestHandler.php
typo3/sysext/frontend/Classes/Middleware/TimeTrackerInitialization.php

index 7eb81e8..647ba77 100644 (file)
@@ -119,8 +119,7 @@ class TypoScriptWaterfall extends AbstractSubModule
                     'content' => (int)$this->getConfigurationOption('displayContent'),
                 ],
                 'trackContentRendering' => (int)$this->getConfigurationOption('LR'),
-                'forceTemplateParsing' => (int)$this->getConfigurationOption('forceTemplateParsing'),
-                'typoScriptLog' => $this->renderTypoScriptLog(),
+                'forceTemplateParsing' => (int)$this->getConfigurationOption('forceTemplateParsing')
             ]
         );
 
index e64f984..3770e9e 100644 (file)
@@ -476,17 +476,17 @@ class TimeTracker implements SingletonInterface
         foreach ($arr as $k => $v) {
             if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($k)) {
                 $c++;
-                $deeper = is_array($arr[$k . '.']);
+                $deeper = isset($arr[$k . '.']);
                 $LN = $ac == $c ? 'blank' : 'line';
 
                 $BTM = $ac == $c ? 'bottom' : '';
-                $PM = is_array($arr[$k . '.']) ? '<i class="fa fa-' . ($deeper ? 'minus' : 'plus') . '-square-o"></i>' : '<span class="treeline-icon treeline-icon-join' . ($BTM ? 'bottom' : '') . '"></span>';
+                $PM = $deeper ? '<i class="fa fa-' . ($deeper ? 'minus' : 'plus') . '-square-o"></i>' : '<span class="treeline-icon treeline-icon-join' . ($BTM ? 'bottom' : '') . '"></span>';
 
                 $this->tsStackLog[$v]['icons'] = $depthData . ($first ? '' : $PM);
                 if ($this->tsStackLog[$v]['content'] !== '') {
                     $content = str_replace($this->tsStackLog[$v]['content'], $v, $content);
                 }
-                if (is_array($arr[$k . '.'])) {
+                if ($deeper) {
                     $this->tsStackLog[$v]['content'] = $this->fixContent($arr[$k . '.'], $this->tsStackLog[$v]['content'], $depthData . ($first ? '' : '<span class="treeline-icon treeline-icon-' . $LN . '"></span>'), 0, $v);
                 } else {
                     $this->tsStackLog[$v]['content'] = $this->fixCLen($this->tsStackLog[$v]['content'], $this->tsStackLog[$v]['value']);
index 761d40b..c82ff87 100644 (file)
@@ -159,7 +159,7 @@ class RequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterf
             GeneralUtility::callUserFunction($_funcRef, $_params, $controller);
         }
 
-        // Finish timetracking
+        // Finish time tracking (started in TYPO3\CMS\Frontend\Middleware\TimeTrackerInitialization)
         $this->timeTracker->pull();
 
         if ($isOutputting) {
index a8b953e..84823f6 100644 (file)
@@ -39,10 +39,13 @@ class TimeTrackerInitialization implements MiddlewareInterface
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
     {
         $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']) ?: 'be_typo_user';
-        GeneralUtility::makeInstance(
+        $timeTracker = GeneralUtility::makeInstance(
             TimeTracker::class,
             $request->getCookieParams()[$configuredCookieName] ? true : false
-        )->start();
+        );
+        $timeTracker->start();
+        $timeTracker->push('');
+
         return $handler->handle($request);
     }
 }