[BUGFIX] Avoid overwriting configured Fluid template paths 75/51575/2
authorNicole Cordes <typo3@cordes.co>
Wed, 8 Feb 2017 10:20:51 +0000 (11:20 +0100)
committerNicole Cordes <typo3@cordes.co>
Wed, 8 Feb 2017 12:47:27 +0000 (13:47 +0100)
Due to change https://review.typo3.org/51283/ the defaultPaths in
Fluid overwrite the configuration paths for the first (0-indexed)
array item. This means currently it is not possible to define an
own Fluid template path with index 0. This patch merges both arrays
and ensures the configuration paths are added at last. This is needed
because Fluid Standalone is using template paths from last to first.

Resolves: #79681
Releases: master
Change-Id: I84398c8218836b46583333bf64ba87ef4a55625d
Reviewed-on: https://review.typo3.org/51575
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/fluid/Classes/View/TemplatePaths.php

index 173bb63..384e193 100644 (file)
@@ -121,7 +121,7 @@ class TemplatePaths extends \TYPO3Fluid\Fluid\View\TemplatePaths
 
         foreach ($paths as $name => $defaultPaths) {
             if (!empty($configuredPaths[$name])) {
-                $paths[$name] = $defaultPaths + (array)$configuredPaths[$name];
+                $paths[$name] = array_merge($defaultPaths, (array)$configuredPaths[$name]);
             }
         }