[BUGFIX] use included TSconfig files in frontend 76/54276/4
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 3 Oct 2017 21:47:10 +0000 (23:47 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sun, 19 Nov 2017 00:57:31 +0000 (01:57 +0100)
The files included in the field tsconfig_includes are now included
when collecting the page TSconfig in the TypoScriptFrontendController.

Resolves: #82662
Releases: master, 8.7
Change-Id: I226f942045647a3b7c4130b9e5d39b6d982efd1b
Reviewed-on: https://review.typo3.org/54276
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index a24ab68..9064417 100644 (file)
@@ -43,6 +43,7 @@ use TYPO3\CMS\Core\TimeTracker\TimeTracker;
 use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
 use TYPO3\CMS\Core\TypoScript\TemplateService;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
@@ -3843,6 +3844,29 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         if (!is_array($this->pagesTSconfig)) {
             $TSdataArray = [];
             foreach ($this->rootLine as $k => $v) {
+                if (trim($v['tsconfig_includes'])) {
+                    $includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true);
+                    // Traversing list
+                    foreach ($includeTsConfigFileList as $key => $includeTsConfigFile) {
+                        if (strpos($includeTsConfigFile, 'EXT:') === 0) {
+                            list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode(
+                                '/',
+                                substr($includeTsConfigFile, 4),
+                                2
+                            );
+                            if ((string)$includeTsConfigFileExtensionKey !== ''
+                                && (string)$includeTsConfigFilename !== ''
+                                && ExtensionManagementUtility::isLoaded($includeTsConfigFileExtensionKey)
+                            ) {
+                                $includeTsConfigFileAndPath = ExtensionManagementUtility::extPath($includeTsConfigFileExtensionKey)
+                                    . $includeTsConfigFilename;
+                                if (file_exists($includeTsConfigFileAndPath)) {
+                                    $TSdataArray[] = file_get_contents($includeTsConfigFileAndPath);
+                                }
+                            }
+                        }
+                    }
+                }
                 $TSdataArray[] = $v['TSconfig'];
             }
             // Adding the default configuration: