Fixed bug #12446: Fixed instantiation of UriBuilder (broken since extbase merge)
authorpsychomieze <psychomieze@743128fe-103e-dd11-99c4-001b210b3e58>
Fri, 21 Jan 2011 16:57:18 +0000 (16:57 +0000)
committerpsychomieze <psychomieze@743128fe-103e-dd11-99c4-001b210b3e58>
Fri, 21 Jan 2011 16:57:18 +0000 (16:57 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/workspaces/trunk@3928 743128fe-103e-dd11-99c4-001b210b3e58

typo3/sysext/workspaces/ChangeLog
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Service/Befunc.php

index 999e671..0f5ed16 100644 (file)
@@ -12,6 +12,7 @@
        * Fixed bug #12413: Rename extension "list" to "recordlist"
        * Fixed bug #12000: Cache and Favorites submenus shifts when in Workspaces
        * Fixed bug #11574: Workspaces grid: stages should "sit" on one line
+       * Fixed bug #12446: Fixed instantiation of UriBuilder (broken since extbase merge)
 
 2011-01-20  Tolleiv Nietsch <typo3@tolleiv.de>
 
index f09f070..12cb3db 100644 (file)
@@ -79,10 +79,11 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                $language = intval(t3lib_div::_GP('L'));
 
                $controller = t3lib_div::makeInstance('Tx_Workspaces_Controller_ReviewController', TRUE);
-               $uriBuilder = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder');
+               /** @var $uriBuilder Tx_Extbase_MVC_Web_Routing_UriBuilder */
+               $uriBuilder = $this->objectManager->create('Tx_Extbase_MVC_Web_Routing_UriBuilder');
 
                $wsSettingsPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
-               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), $controller, 'workspaces', 'web_workspacesworkspaces');
+               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'Tx_Workspaces_Controller_ReviewController', 'workspaces', 'web_workspacesworkspaces');
                $wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
                $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
 
@@ -92,7 +93,7 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                // @todo - handle new pages here
                // branchpoints are not handled anymore because this feature is not supposed anymore
                if (tx_Workspaces_Service_Workspaces::isNewPage($this->pageId)) {
-                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), $this, 'workspaces', 'web_workspacesworkspaces');
+                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces');
                        $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
                        $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
                } else {
index 0ad82e4..ce0995e 100644 (file)
@@ -56,7 +56,9 @@ class tx_Workspaces_Service_Befunc {
 
                if ($GLOBALS['BE_USER']->workspace !== 0) {
                        $ctrl = t3lib_div::makeInstance('Tx_Workspaces_Controller_PreviewController', FALSE);
-                       $uriBuilder = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder');
+                       $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+                       /** @var $uriBuilder Tx_Extbase_MVC_Web_Routing_UriBuilder */
+                       $uriBuilder = $objectManager->create('Tx_Extbase_MVC_Web_Routing_UriBuilder');
                        /**
                         *  This seems to be very harsh to set this directly to "/typo3 but the viewOnClick also
                         *  has /index.php as fixed value here and dealing with the backPath is very error-prone
@@ -66,7 +68,7 @@ class tx_Workspaces_Service_Befunc {
                        $backPath = '/' . TYPO3_mainDir;
                                // @todo why do we need these additional params? the URIBuilder should add the controller, but he doesn't :(
                        $additionalParams = '&tx_workspaces_web_workspacesworkspaces%5Bcontroller%5D=Preview&M=web_WorkspacesWorkspaces&id=';
-                       $viewScript = $backPath . $uriBuilder->uriFor('index', array(), $ctrl, 'workspaces', 'web_workspacesworkspaces') . $additionalParams;
+                       $viewScript = $backPath . $uriBuilder->uriFor('index', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces') . $additionalParams;
                }
        }