Fixed bug #14555: early thrown debug messages are not visible (BE only) (Thanks to...
authorSteffen Kamper <info@sk-typo3.de>
Wed, 9 Jun 2010 15:31:54 +0000 (15:31 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 9 Jun 2010 15:31:54 +0000 (15:31 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7850 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 2f8d73a..a053913 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-06-08  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14555: early thrown debug messages are not visible (BE only) (Thanks to Stefan Galinski)
        * Fixed bug #14628: Open t3lib_db for own instance
        * Follow-up to bug #8305: SQL debug output is not shown in the Backend
        * Fixed bug #14618: Bug: Add debug feature to Ext Direct (Thanks to Fabien Udriot)
index 705b38e..be94943 100644 (file)
@@ -3624,7 +3624,7 @@ final class t3lib_div {
                        if ($header !== '') {
                                $tabHeader = htmlspecialchars($header);
                        } else {
-                       $tabHeader = 'Debug';
+                               $tabHeader = 'Debug';
                        }
                        
                        if (is_object($var)) {
@@ -3642,22 +3642,36 @@ final class t3lib_div {
                        }
 
                        $script = '
-                               var TYPO3ViewportInstance = null;
-                               var debugMessage = "' . $debug . '";
-                               var header = "' . $tabHeader . '";
-                               var group = "' . $group . '";
-
-                               if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
-                                       TYPO3ViewportInstance = top.TYPO3.Backend;
-                               } else if (typeof TYPO3 === "object" && typeof TYPO3.Backend === "object") {
-                                       TYPO3ViewportInstance = TYPO3.Backend;
-                               }
+                               (function debug() {
+                                       var debugMessage = "' . $debug . '";
+                                       var header = "' . $tabHeader . '";
+                                       var group = "' . $group . '";
+
+                                       if (typeof Ext !== "object" && (top && typeof top.Ext !== "object")) {
+                                               document.write(debugMessage);
+                                               return;
+                                       }
 
-                               if (TYPO3ViewportInstance !== null) {
-                                       TYPO3ViewportInstance.DebugConsole.addTab(debugMessage, header, group);
-                               } else {
-                                       document.write(debugMessage);
-                               }
+                                       if (top && typeof Ext !== "object") {
+                                               Ext = top.Ext;  
+                                       }
+
+                                       Ext.onReady(function() {
+                                               var TYPO3ViewportInstance = null;
+
+                                               if (top && top.TYPO3 && typeof top.TYPO3.Backend === "object") {
+                                                       TYPO3ViewportInstance = top.TYPO3.Backend;
+                                               } else if (typeof TYPO3 === "object" && typeof TYPO3.Backend === "object") {
+                                                       TYPO3ViewportInstance = TYPO3.Backend;
+                                               }
+
+                                               if (TYPO3ViewportInstance !== null) {
+                                                       TYPO3ViewportInstance.DebugConsole.addTab(debugMessage, header, group);
+                                               } else {
+                                                       document.write(debugMessage);
+                                               }
+                                       });
+                               })();
                        ';
                        echo self::wrapJS($script);
                } else {