[BUGFIX] Fix viewObjectNamePattern regression in Extbase 79/23679/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:40:38 +0000 (21:40 +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/23679
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php

index 09afcdc..3757560 100644 (file)
@@ -58,15 +58,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.
@@ -400,9 +400,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();