From 5c834a117b7749773cf15ea519a988a5ba438d37 Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Mon, 12 Mar 2018 23:04:29 +0100 Subject: [PATCH] [BUGFIX] Ensure TSconfig order is identical in BE and FE Make sure the inclusion order of TSconfig (files and record field) are identical in BE and FE. As BE and FE use different algorithms, FE is adjusted to match the BE behaviour, which is the expected one. Resolves: #84227 Releases: master, 8.7 Change-Id: Idb4afbd736ed65890850ee75d572a55c3a5ab24d Reviewed-on: https://review.typo3.org/56122 Tested-by: TYPO3com Reviewed-by: Wouter Wolters Reviewed-by: Andreas Fernandez Reviewed-by: Stefan Neufeind Tested-by: Stefan Neufeind Reviewed-by: Susanne Moog Tested-by: Susanne Moog --- .../Classes/Controller/TypoScriptFrontendController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 43740d845e08..0dbfdf70566c 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -3964,10 +3964,14 @@ public function getPagesTSconfig() if (!is_array($this->pagesTSconfig)) { $TSdataArray = []; foreach ($this->rootLine as $k => $v) { + // add TSconfig first, as $TSdataArray is reversed below and it shall be included last + $TSdataArray[] = $v['TSconfig']; if (trim($v['tsconfig_includes'])) { $includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true); + // reverse the includes first to make sure their order is preserved when $TSdataArray is reversed + $includeTsConfigFileList = array_reverse($includeTsConfigFileList); // Traversing list - foreach ($includeTsConfigFileList as $key => $includeTsConfigFile) { + foreach ($includeTsConfigFileList as $includeTsConfigFile) { if (strpos($includeTsConfigFile, 'EXT:') === 0) { list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode( '/', @@ -3987,7 +3991,6 @@ public function getPagesTSconfig() } } } - $TSdataArray[] = $v['TSconfig']; } // Adding the default configuration: $TSdataArray[] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];