[BUGFIX] InlineSettings broken if extJs not loaded 93/20393/2
authorBenjamin Mack <benni@typo3.org>
Sat, 6 Apr 2013 10:11:52 +0000 (12:11 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 1 May 2013 20:04:00 +0000 (22:04 +0200)
The pagerenderer can add javascript inline settings to the output.
This does not work if extJs is not loaded, because of missing
initialization of js object TYPO3.
This patch makes sure that TYPO3 object is iniitalized correctly,
if extJs is not loaded.

Change-Id: I2f9750cd0188cbbb042d02b6d3f5c6da2a544589
Fixes: #38879
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/20393
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Page/PageRenderer.php

index 76b1f5e..e231eea 100644 (file)
@@ -2102,7 +2102,10 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                                }
                        }
                } else {
-                       if ($inlineSettings) {
+                       // no extJS loaded, but still inline settings
+                       if ($inlineSettings !== '') {
+                               // make sure the global TYPO3 is available
+                               $inlineSettings = 'var TYPO3 = TYPO3 || {};' . CRLF . $inlineSettings;
                                $out .= $this->inlineJavascriptWrap[0] . $inlineSettings . $this->inlineJavascriptWrap[1];
                        }
                }