Skip to content

Commit

Permalink
[BUGFIX] Drop "LIVE workspace" tab from workspace module
Browse files Browse the repository at this point in the history
The "LIVE workspace" tab of the workspace module always
showed wrong records from other workspaces. This issue
has been resolved with the pid=-1 removal in v10.

Since then, this tab never shows records. The patch
removes the tab from the interface. Users, including
admins, now see a "Please select a workspace first"
message when calling the module in online / live
workspace.

Resolves: #91983
Related: #89122
Related: #13056
Releases: master, 10.4
Change-Id: Ib1029253d53745d82786f31276283e5f88ebf9b4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65284
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Achim Fritz <af@achimfritz.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Achim Fritz <af@achimfritz.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
lolli42 authored and andreaskienast committed Aug 12, 2020
1 parent 8a2bff5 commit 51fbd31
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions typo3/sysext/workspaces/Classes/Controller/ReviewController.php
Expand Up @@ -179,7 +179,7 @@ public function indexAction()
$this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', (int)$backendUser->workspace === 0);
$this->pageRenderer->addInlineSetting('Workspaces', 'workspaceTabs', $this->prepareWorkspaceTabs($wsList, $activeWorkspace));
$this->pageRenderer->addInlineSetting('Workspaces', 'activeWorkspaceId', $activeWorkspace);
$workspaceIsAccessible = !($backendUser->workspace === 0 && !$backendUser->isAdmin());
$workspaceIsAccessible = $backendUser->workspace !== WorkspaceService::LIVE_WORKSPACE_ID;
$this->view->assignMultiple([
'showGrid' => $workspaceIsAccessible,
'showLegend' => $workspaceIsAccessible,
Expand Down Expand Up @@ -265,7 +265,9 @@ protected function prepareWorkspaceTabs(array $workspaceList, int $activeWorkspa
{
$tabs = [];

if ($activeWorkspace !== WorkspaceService::SELECT_ALL_WORKSPACES) {
if ($activeWorkspace !== WorkspaceService::SELECT_ALL_WORKSPACES
&& $activeWorkspace !== WorkspaceService::LIVE_WORKSPACE_ID
) {
$tabs[] = [
'title' => $workspaceList[$activeWorkspace],
'itemId' => 'workspace-' . $activeWorkspace,
Expand All @@ -284,7 +286,9 @@ protected function prepareWorkspaceTabs(array $workspaceList, int $activeWorkspa
}

foreach ($workspaceList as $workspaceId => $workspaceTitle) {
if ($workspaceId === $activeWorkspace) {
if ($workspaceId === $activeWorkspace
|| $workspaceId === WorkspaceService::LIVE_WORKSPACE_ID
) {
continue;
}
$tabs[] = [
Expand Down

0 comments on commit 51fbd31

Please sign in to comment.