[BUGFIX] Don't run processIncludes more than once 48/26748/11
authorPeter Niederlag <netservice@niekom.de>
Fri, 10 Jan 2014 17:47:16 +0000 (18:47 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Fri, 11 Apr 2014 23:30:29 +0000 (01:30 +0200)
processIncludes() is run "mandatory" from the stack ->start()
->runThroughTemplates() and doing all the work that needs to be done.

Resolves: #54903
Releases: 6.2
Change-Id: Id2be1a25aa23a05849297315c74358a9ef4ff9bb
Reviewed-on: https://review.typo3.org/26748
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index 6337fb2..812a335 100644 (file)
@@ -322,6 +322,16 @@ class TemplateService {
        protected $isDefaultTypoScriptAdded = FALSE;
 
        /**
+        * Set to TRUE after $this->config and $this->constants have processed all <INCLUDE_TYPOSCRIPT:> instructions.
+        *
+        * This prevents double processing of INCLUDES.
+        *
+        * @see processIncludes()
+        * @var boolean
+        */
+       protected $processIncludesHasBeenRun = FALSE;
+
+       /**
         * @return boolean
         */
        public function getProcessExtensionStatics() {
@@ -1039,6 +1049,10 @@ class TemplateService {
         * @see \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser, generateConfig()
         */
        public function processIncludes() {
+               if ($this->processIncludesHasBeenRun) {
+                       return;
+               }
+
                $files = array();
                foreach ($this->constants as &$value) {
                        $includeData = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines($value, 1, TRUE);
@@ -1052,12 +1066,15 @@ class TemplateService {
                        $value = $includeData['typoscript'];
                }
                unset($value);
-               if (count($files)) {
+
+               if (!empty($files)) {
                        $files = array_unique($files);
                        foreach ($files as $file) {
                                $this->rowSum[] = array($file, filemtime($file));
                        }
                }
+
+               $this->processIncludesHasBeenRun = TRUE;
        }
 
        /**