[BUGFIX] Javascript for TMENU_LAYERS and GMENU_LAYERS missing 66/19266/2
authorMichael Stucki <michael.stucki@typo3.org>
Mon, 25 Mar 2013 13:45:34 +0000 (14:45 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 09:37:57 +0000 (11:37 +0200)
If using GMENU_LAYERS/TMENU_LAYERS and (for example) indexed_search on
the same page, the JavaScript header tags are missing if the page is
loaded from the cache.

Resolves: #36719
Releases: 4.5, 4.6, 4.7, 6.0, 6.1
Change-Id: Icd52f68d2b9462360f0b9efd912d93d4b0c1048c
Reviewed-on: https://review.typo3.org/19266
Reviewed-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/frontend/Classes/ContentObject/Menu/JavaScriptMenuContentObject.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php

index dfb892a..cd49b1e 100644 (file)
@@ -66,7 +66,7 @@ class JavaScriptMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu
                        }
                        $JScode .= $this->generate_level($levels, 1, $this->id, $this->menuArr, $this->MP_array) . LF;
                        $GLOBALS['TSFE']->additionalHeaderData['JSMenuCode'] = '<script type="text/javascript" src="' . $GLOBALS['TSFE']->absRefPrefix . 't3lib/jsfunc.menu.js"></script>';
-                       $GLOBALS['TSFE']->JSCode .= $JScode;
+                       $GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= $JScode;
                        // Printing:
                        $allFormCode = '';
                        for ($a = 1; $a <= $this->levels; $a++) {
index e74ea23..8fb6fb4 100644 (file)
@@ -91,7 +91,7 @@ class PageGenerator {
                $GLOBALS['TSFE']->absRefPrefix = $GLOBALS['TSFE']->config['config']['absRefPrefix'] ? trim($GLOBALS['TSFE']->config['config']['absRefPrefix']) : '';
                if ($GLOBALS['TSFE']->type && $GLOBALS['TSFE']->config['config']['frameReloadIfNotInFrameset']) {
                        $tdlLD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page, '_top', $GLOBALS['TSFE']->no_cache, '');
-                       $GLOBALS['TSFE']->JSCode = 'if(!parent.' . trim($GLOBALS['TSFE']->sPre) . ' && !parent.view_frame) top.location.href="' . $GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']) . '"';
+                       $GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= 'if(!parent.' . trim($GLOBALS['TSFE']->sPre) . ' && !parent.view_frame) top.location.href="' . $GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']) . '"';
                }
                $GLOBALS['TSFE']->compensateFieldWidth = '' . $GLOBALS['TSFE']->config['config']['compensateFieldWidth'];
                $GLOBALS['TSFE']->lockFilePath = '' . $GLOBALS['TSFE']->config['config']['lockFilePath'];