[BUGFIX] getAvailableWorkspaces called statically 62/30962/2
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 20 Jun 2014 18:28:14 +0000 (20:28 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 21 Jun 2014 14:01:44 +0000 (16:01 +0200)
Use same call to getAvailableWorkspaces as in
checkAccess.

Resolves: #51420
Releases: 6.3, 6.2
Change-Id: Icbea4611d7bd498e25bf658d7f3fa5a74539f479
Reviewed-on: https://review.typo3.org/30962
Reviewed-by: Oliver Klee
Reviewed-by: Robert van Kammen
Tested-by: Robert van Kammen
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php

index 058bf57..48f46ec 100644 (file)
@@ -98,7 +98,9 @@ class WorkspaceSelectorToolbarItem implements \TYPO3\CMS\Backend\Toolbar\Toolbar
                $this->addJavascriptToBackend();
 
                $index = 0;
-               $availableWorkspaces = \TYPO3\CMS\Workspaces\Service\WorkspaceService::getAvailableWorkspaces();
+               /** @var \TYPO3\CMS\Workspaces\Service\WorkspaceService $wsService */
+               $wsService = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\WorkspaceService');
+               $availableWorkspaces = $wsService->getAvailableWorkspaces();
                $activeWorkspace = (int)$GLOBALS['BE_USER']->workspace;
                $stateCheckedIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked');
                $stateUncheckedIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('empty-empty', array(
@@ -167,4 +169,4 @@ class WorkspaceSelectorToolbarItem implements \TYPO3\CMS\Backend\Toolbar\Toolbar
 
 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
        $GLOBALS['TYPO3backend']->addToolbarItem('workSpaceSelector', 'TYPO3\\CMS\\Workspaces\\ExtDirect\\WorkspaceSelectorToolbarItem');
-}
\ No newline at end of file
+}