[BUGFIX] Do not cache fallback View paths 64/51564/3
authorClaus Due <claus@namelesscoder.net>
Tue, 7 Feb 2017 13:25:41 +0000 (14:25 +0100)
committerNicole Cordes <typo3@cordes.co>
Wed, 8 Feb 2017 11:07:52 +0000 (12:07 +0100)
This patch fixes an issue with TemplatePaths, where paths
for a given extension key get used at two execution points:

* Before TS becomes available
* At any time after TS becomes available

In this case, TemplatePaths holds on to the fallback paths
which the first rendering detects (since TS is not availble,
fallback paths get returned) and all subsequent rendering
of any template in that extension context, yields only the
fallback paths and ignores what is defined in TS.

By not allowing fallback paths to be cached in runtime, the
problem is prevented.

Change-Id: Idd0216f67f9a7f875a4509b34c9a32f66208db93
Resolves: #79662
Releases: master
Reviewed-on: https://review.typo3.org/51564
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Morten Pless <mpl@systime.dk>
Tested-by: Morten Pless <mpl@systime.dk>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Claus Due <claus@phpmind.net>
Tested-by: Claus Due <claus@phpmind.net>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/fluid/Classes/View/TemplatePaths.php

index 5c4b665..173bb63 100644 (file)
@@ -115,6 +115,10 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths
             }
         }
 
+        if (empty($configuredPaths)) {
+            return $paths;
+        }
+
         foreach ($paths as $name => $defaultPaths) {
             if (!empty($configuredPaths[$name])) {
                 $paths[$name] = $defaultPaths + (array)$configuredPaths[$name];
@@ -122,6 +126,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths
         }
 
         $cache->set($cacheIdentifier, $paths);
+
         return $paths;
     }