Revert "[BUGFIX] TS is fetched from cache incorrectly sometimes" 70/18070/2
authorOliver Hader <oliver.hader@typo3.org>
Wed, 6 Feb 2013 18:37:44 +0000 (19:37 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 6 Feb 2013 18:39:07 +0000 (19:39 +0100)
This reverts commit 4fbb2b5852a98b1eb3e935d79d612468896291f1

Change-Id: I2f936cabac3392f0c7eeb85cda9caad68b59553d
Reviewed-on: https://review.typo3.org/18070
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index 6601b13..f5c9fed 100644 (file)
@@ -300,13 +300,6 @@ class TemplateService {
        public $MPmap = '';
 
        /**
-        * TRUE after the default TS is added during parsing. This prevents double addition of the same TS code.
-        *
-        * @var boolean
-        */
-       protected $defaultTSAdded = FALSE;
-
-       /**
         * Initialize
         * MUST be called directly after creating a new template-object
         *
@@ -459,14 +452,7 @@ class TemplateService {
                        if ($setupData && !$this->forceTemplateParsing) {
                                // If TypoScript setup structure was cached we unserialize it here:
                                $this->setup = unserialize($setupData);
-                               if ($this->tt_track) {
-                                       $GLOBALS['TT']->setTSLogMessage('Using cached TS template data');
-                               }
                        } else {
-                               if ($this->tt_track) {
-                                       $GLOBALS['TT']->setTSLogMessage('Not using any cached TS data');
-                               }
-
                                // Make configuration
                                $this->generateConfig();
                                // This stores the template hash thing
@@ -531,9 +517,8 @@ class TemplateService {
                $this->config = array();
                $this->rowSum = array();
                $this->hierarchyInfoToRoot = array();
+               // Is the TOTAL rootline
                $this->absoluteRootLine = $theRootLine;
-               $this->defaultTSAdded = FALSE;
-
                reset($this->absoluteRootLine);
                $c = count($this->absoluteRootLine);
                for ($a = 0; $a < $c; $a++) {
@@ -566,13 +551,6 @@ class TemplateService {
                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
                        $this->rootLine[] = $this->absoluteRootLine[$a];
                }
-
-               if (!$this->defaultTSAdded) {
-                       array_unshift($this->constants, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
-                       array_unshift($this->config, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
-                       $this->defaultTSAdded = TRUE;
-               }
-
                $this->processIncludes();
        }
 
@@ -847,13 +825,11 @@ class TemplateService {
         * @todo Define visibility
         */
        public function generateConfig() {
-               if (!$this->defaultTSAdded) {
-                       // Add default TS for all code types
-                       array_unshift($this->constants, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
-                       array_unshift($this->config, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
-                       $this->defaultTSAdded = TRUE;
-               }
-
+               // Add default TS for all three code types:
+               array_unshift($this->constants, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
+               // Adding default TS/constants
+               array_unshift($this->config, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
+               // Adding default TS/setup
                // Parse the TypoScript code text for include-instructions!
                $this->processIncludes();
                // These vars are also set lateron...
@@ -1562,4 +1538,4 @@ class TemplateService {
 }
 
 
-?>
+?>
\ No newline at end of file