[BUGFIX] Forward header in DebugUtility:debug to renderDump 73/55473/4
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 28 Jan 2018 11:37:17 +0000 (12:37 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 5 Feb 2018 19:44:28 +0000 (20:44 +0100)
Improve the debug output by forwarding the given title.

Resolves: #83688
Releases: master, 8.7
Change-Id: I160b5676c5ff70c056319446733c9549a663569a
Reviewed-on: https://review.typo3.org/55473
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Tested-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Utility/DebugUtility.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index ef0f958..a51b8f2 100644 (file)
@@ -39,21 +39,21 @@ class DebugUtility
      * @param string $header
      * @param string $group
      */
-    public static function debug($var = '', $header = '', $group = 'Debug')
+    public static function debug($var = '', $header = 'Debug', $group = 'Debug')
     {
         // buffer the output of debug if no buffering started before
         if (ob_get_level() === 0) {
             ob_start();
         }
+
         if (TYPO3_MODE === 'BE' && !self::isCommandLine()) {
-            $tabHeader = $header ?: 'Debug';
             $debug = self::renderDump($var);
             $debugPlain = PHP_EOL . self::renderDump($var, '', true, false);
             $script = '
                                (function debug() {
                                        var message = ' . GeneralUtility::quoteJSvalue($debug) . ',
                                                messagePlain = ' . GeneralUtility::quoteJSvalue($debugPlain) . ',
-                                               header = ' . GeneralUtility::quoteJSvalue($tabHeader) . ',
+                                               header = ' . GeneralUtility::quoteJSvalue($header) . ',
                                                group = ' . GeneralUtility::quoteJSvalue($group) . ';
                                        if (top.TYPO3 && top.TYPO3.DebugConsole) {
                                                top.TYPO3.DebugConsole.add(message, header, group);
@@ -67,7 +67,7 @@ class DebugUtility
                        ';
             echo GeneralUtility::wrapJS($script);
         } else {
-            echo self::renderDump($var);
+            echo self::renderDump($var, $header);
         }
     }
 
index f0b7752..2fe932b 100644 (file)
@@ -4677,7 +4677,7 @@ class ContentObjectRendererTest extends \TYPO3\TestingFramework\Core\Unit\UnitTe
         $result = $this->subject->stdWrap_debugData($content);
         $out = ob_get_clean();
         $this->assertSame($result, $content);
-        $this->assertNotContains('$cObj->data', $out);
+        $this->assertContains('$cObj->data', $out);
         $this->assertContains($value, $out);
         $this->assertNotContains($altValue, $out);
         // By adding alternative data both are returned together.