[BUGFIX] Respect rootline order for getPagesTSconfig() 98/41798/4
authorDaniel Goerz <ervaude@gmail.com>
Tue, 21 Jul 2015 22:12:06 +0000 (00:12 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 28 Jul 2015 19:08:24 +0000 (21:08 +0200)
The method TypoScriptFrontendController::getPagesTSconfig() now
respects overrides via TSconfig and now returns the actual
configuration valid for the current page.

Change-Id: I1288086b51f8c5b3d96853fb7669a9cbb11ecaef
Resolves: #22710
Releases: master
Reviewed-on: http://review.typo3.org/41798
Reviewed-by: Ralf Merz <info@merzilla.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index bd56fc6..73e5621 100644 (file)
@@ -4164,11 +4164,13 @@ class TypoScriptFrontendController {
        public function getPagesTSconfig() {
                if (!is_array($this->pagesTSconfig)) {
                        $TSdataArray = array();
-                       // Setting default configuration:
-                       $TSdataArray[] = $this->TYPO3_CONF_VARS['BE']['defaultPageTSconfig'];
                        foreach ($this->rootLine as $k => $v) {
                                $TSdataArray[] = $v['TSconfig'];
                        }
+                       // Adding the default configuration:
+                       $TSdataArray[] = $this->TYPO3_CONF_VARS['BE']['defaultPageTSconfig'];
+                       // Bring everything in the right order. Default first, then the Rootline down to the current page
+                       $TSdataArray = array_reverse($TSdataArray);
                        // Parsing the user TS (or getting from cache)
                        $TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
                        $userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);