[BUGFIX] Fix viewObjectNamePattern regression in Extbase 68/23668/2
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Sat, 7 Sep 2013 10:19:14 +0000 (12:19 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 8 Sep 2013 19:22:23 +0000 (21:22 +0200)
http://forge.typo3.org/issues/47609 introduced an Extbase
regression by changing the behaviour of viewObjectNamePattern
in the ActionController without deprecating it first.

This patch fixes this regression but keeps the wanted behaviour
by resetting the value of viewObjectNamePattern and introducing
a namespacedViewObjectNamePattern with the namespaced pattern.

Resolves: #51758
Releases: 6.2, 6.1, 6.0
Change-Id: Ie32b178e1799c396e969fd48f81f9fe6243f6e70
Reviewed-on: https://review.typo3.org/23668
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Mattias Nilsson
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php

index 75cc0b6..4b73927 100644 (file)
@@ -60,15 +60,15 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
         *
         * @var string
         * @api
+        * @deprecated since Extbase 6.2, will be removed two versions later
         */
-       protected $viewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format';
+       protected $viewObjectNamePattern = 'Tx_@extension_View_@controller_@action@format';
 
        /**
         * @var string
         * @api
-        * @deprecated since Extbase 6.2, will be removed two versions later
         */
-       protected $deprecatedViewObjectNamePattern = 'Tx_@extension_View_@controller_@action@format';
+       protected $namespacesViewObjectNamePattern = '@vendor\@extension\View\@controller\@action@format';
 
        /**
         * A list of formats and object names of the views which should render them.
@@ -410,9 +410,9 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
                $vendorName = $this->request->getControllerVendorName();
 
                if ($vendorName !== NULL) {
-                       $possibleViewName = str_replace('@vendor', $vendorName, $this->viewObjectNamePattern);
+                       $possibleViewName = str_replace('@vendor', $vendorName, $this->namespacesViewObjectNamePattern);
                } else {
-                       $possibleViewName = $this->deprecatedViewObjectNamePattern;
+                       $possibleViewName = $this->viewObjectNamePattern;
                }
 
                $extensionName = $this->request->getControllerExtensionName();