[BUGFIX] Assure correct INCLUDE_TYPOSCRIPT with relative paths on subpages 52/44952/2
authorDaniel Goerz <ervaude@gmail.com>
Thu, 26 Nov 2015 11:41:44 +0000 (12:41 +0100)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 27 Nov 2015 09:02:46 +0000 (10:02 +0100)
If a subpage has a template that clears the setup, INCLUDE_TYPOSCRIPT
will not work with relative paths anymore. This patch assures that always
the correct file is included.

Change-Id: I43b524c7c0fde7211ccbfc8481e2bbfd00bb4c0e
Resolves: #71197
Releases: master, 6.2
Reviewed-on: https://review.typo3.org/44952
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index 7a59601..112730a 100644 (file)
@@ -627,11 +627,19 @@ class TemplateService {
                        $clConst = $row['clear'] & 1;
                        $clConf = $row['clear'] & 2;
                        if ($clConst) {
-                               $this->constants = array();
+                               // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
+                               foreach ($this->constants as &$constantConfiguration) {
+                                       $constantConfiguration = '';
+                               }
+                               unset($constantConfiguration);
                                $this->clearList_const = array();
                        }
                        if ($clConf) {
-                               $this->config = array();
+                               // Keep amount of items to stay in sync with $this->templateIncludePaths so processIncludes() does not break
+                               foreach ($this->config as &$configConfiguration) {
+                                       $configConfiguration = '';
+                               }
+                               unset($configConfiguration);
                                $this->hierarchyInfoToRoot = array();
                                $this->clearList_setup = array();
                        }