[BUGFIX] Always evaluate stdWrap on templateName 43/44343/2
authorMarkus Klein <markus.klein@typo3.org>
Thu, 29 Oct 2015 00:17:05 +0000 (01:17 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Oct 2015 18:47:14 +0000 (19:47 +0100)
Properly check if stdWrap for templateName of FLUIDTEMPLATE is present
and evaluate it, even if templateName itself has no value.

Resolves: #71113
Releases: master
Change-Id: I76f2b6111856aee845ff10a5ddc054f75b6e9105
Reviewed-on: https://review.typo3.org/44343
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php

index e1b9391..a52d987 100644 (file)
@@ -130,10 +130,15 @@ class FluidTemplateContentObject extends AbstractContentObject
     protected function setTemplate(array $conf)
     {
         // Fetch the Fluid template by templateName
-        if (!empty($conf['templateName']) && !empty($conf['templateRootPaths.']) && is_array($conf['templateRootPaths.'])) {
+        if (
+            (!empty($conf['templateName']) || !empty($conf['templateName.']))
+            && !empty($conf['templateRootPaths.']) && is_array($conf['templateRootPaths.'])
+        ) {
             $templateRootPaths = $this->applyStandardWrapToFluidPaths($conf['templateRootPaths.']);
             $this->view->setTemplateRootPaths($templateRootPaths);
-            $templateName = isset($conf['templateName.']) ? $this->cObj->stdWrap($conf['templateName'], $conf['templateName.']) : $conf['templateName'];
+            $templateName = isset($conf['templateName.'])
+                ? $this->cObj->stdWrap(isset($conf['templateName']) ? $conf['templateName'] : '', $conf['templateName.'])
+                : $conf['templateName'];
             $this->view->setTemplate($templateName);
         // Fetch the Fluid template by template cObject
         } elseif (!empty($conf['template']) && !empty($conf['template.'])) {