[BUGFIX] getAvailableWorkspaces called statically
[Packages/TYPO3.CMS.git] / 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
+}