[BUGFIX] use included TSconfig files in frontend 80/54680/2
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 01:37:22 +0000 (02:37 +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/54680
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index b21b60a..fb54d34 100644 (file)
@@ -4122,6 +4122,29 @@ class TypoScriptFrontendController
         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: