[BUGFIX] Properly set format of StandaloneView 16/52616/2
authorMarkus Klein <markus.klein@typo3.org>
Tue, 25 Apr 2017 08:52:12 +0000 (10:52 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 26 Apr 2017 16:43:21 +0000 (18:43 +0200)
The internal TemplatePaths object of the BaseRenderingContext
needs to updated as well, when the format of a view is changed.

Resolves: #81003
Releases: master, 8.7
Change-Id: Ibb157f6f042b387ba008d1c9cebfcf3a3681141b
Reviewed-on: https://review.typo3.org/52616
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid/Classes/View/StandaloneView.php
typo3/sysext/fluid/Classes/View/TemplateView.php

index cd4891c..f354a17 100644 (file)
@@ -91,6 +91,7 @@ class StandaloneView extends AbstractTemplateView
     {
         if ($this->baseRenderingContext instanceof RenderingContext) {
             $this->baseRenderingContext->getControllerContext()->getRequest()->setFormat($format);
+            $this->baseRenderingContext->getTemplatePaths()->setFormat($format);
         } else {
             throw new \RuntimeException('The rendering context must be of type ' . RenderingContext::class, 1482251886);
         }
@@ -189,7 +190,7 @@ class StandaloneView extends AbstractTemplateView
     /**
      * Resolves the layout root to be used inside other paths.
      *
-     * @return string Fluid layout root path
+     * @return array Fluid layout root paths
      * @throws InvalidTemplateResourceException
      * @api
      */
@@ -213,7 +214,7 @@ class StandaloneView extends AbstractTemplateView
     /**
      * Returns the absolute path to the folder that contains Fluid partial files
      *
-     * @return string Fluid partial root path
+     * @return array Fluid partial root paths
      * @throws InvalidTemplateResourceException
      * @api
      */
index 187c01b..728e596 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Fluid\View;
  */
 
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
-use TYPO3\CMS\Fluid\Fluid;
 use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException;
 
 /**