Project

General

Profile

Actions

Bug #90954

closed

Workspace switch does not work with editor user (non-admin)

Added by Riccardo De Contardi over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Workspaces
Target version:
-
Start date:
2020-04-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Prerequisites

  • TYPO3: 10.3.0 (really fresh installation)
  • an "Editors" BE group, with full ACL, db mount from home, filemounts, Edit Live: YES
  • an "Editor" BE user; inherits mounts from group (Editors); Edit Live: YES
  • A "draft" workspace; no custom stages, mountpoint: Home; Members: Editor (the user)

Test 1

1) with admin user-> Live workspace -> create a CE with headline "LIVE", save
2) switch to draft workspace -> edit the element, change it into "DRAFT", save
3) log in with editor (I used a different browser)

Results:

a. when logged in you are already in draft workspace
b. switch to LIVE and visit the page with the CE created at point 1) of test 1
c. you are seeing the DRAFT version (!)
d. if you refresh your browser, you will get again in draft workspace

Test 2

1) as admin user -> edit the workspace, and set as Members: Editors (the group) and remove Editor (the user)
2) log in with editor (I used a different browser)

Results:

a. when logged in, you are in LIVE workspace
b. switch to draft workspace and visit the page with the CE created at point 1) of the test 1
c. you are seeing the LIVE version (!)

Conclusion:

I could be wrong , but it seems that the workspace switch is not working at all_, and it just refreshes the top header but not the rest of the CMS.

additional notes

1) the effect is more evident if you change the page title of a page in the draft workspace, it is evident that the workspace switch does not work properly
2) The issue is present only on 10.3 and above, it does not affect 9.5.x
3) The issue only affects editor users, it does not appear with admin users.
4) The issue is present also if you put the editor user/editors group as workspace owners
5) It is not browser-dependent

additional informations

I am using MAMP on MAC, with PHP 7.3.9, but it seems to happen also with 7.2.22 and 7.4.1

Actions #1

Updated by Riccardo De Contardi over 4 years ago

  • Description updated (diff)
Actions #2

Updated by Riccardo De Contardi over 4 years ago

great big thanks to Oliver Hader, who was able to find out that (taken from conversation from Slack)

reloading issue seems to be related to https://review.typo3.org/c/Packages/TYPO3.CMS/+/62887 (workspace ID defined in middleware and written to database - RACE CONDITION between reloading frames setting different workspace IDs)
other scenarios in the backend are basically related to that (since it shows “your are in LIVE”, but actually “you are in DRAFT” concerning persisted value in be_users.workspace_id )
Reverting commit 7ffd8cb0c7ea065e41cbc56b09190edb2e8f2fe4 solves the issue…

Actions #3

Updated by Oliver Hader over 4 years ago

  • Assignee set to Oliver Hader
Actions #4

Updated by Oliver Hader over 4 years ago

That's how invocations to BackendUserAuthentication->setWorkspace($workspaceId) look like when switching workspaces 1 → 0

  • {"requestId":"af786a76bdffc","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/workspace/switch&token=31a763cb3336c50d5eec3c98730bf7120606ef1e"}
    - expected 1 → 0
  • {"requestId":"af786a76bdffc","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/workspace/switch&token=31a763cb3336c50d5eec3c98730bf7120606ef1e"}
    - 2nd time in same request?
  • {"requestId":"af786a76bdffc","workspaceId":0,
    "uri":"/typo3/index.php?route=/ajax/workspace/switch&token=31a763cb3336c50d5eec3c98730bf7120606ef1e"}
    - 3rd time in same request?

  • {"requestId":"8a77d02554b97","workspaceId":0,
    "uri":"/typo3/index.php?route=/ajax/module-menu&token=d530b4d341631c6245d1a3bd060a1af168c1cffb"}
    - correct 0
  • {"requestId":"8a77d02554b97","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/module-menu&token=d530b4d341631c6245d1a3bd060a1af168c1cffb"}
    - falling back to 1 in same request?

  • {"requestId":"2231fc919246f","workspaceId":1,
    "uri":"/typo3/index.php?route=/module/web/layout&token=4a40699198783809ea06205bf3eebf1fc3fe45a8"}
    - all the following are wrong again
  • {"requestId":"2231fc919246f","workspaceId":1,
    "uri":"/typo3/index.php?route=/module/web/layout&token=4a40699198783809ea06205bf3eebf1fc3fe45a8"}

  • {"requestId":"6a7e098fe2069","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/page/tree/fetchConfiguration&token=1e97dd7096999d9d90e283aa1d9fc929b3ab2122"}
  • {"requestId":"6a7e098fe2069","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/page/tree/fetchConfiguration&token=1e97dd7096999d9d90e283aa1d9fc929b3ab2122"}

  • {"requestId":"f3c2481a7fbfa","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/page/tree/fetchData&token=1d0842ee19f7c32ce12437576cd93d92d5194c30"}
  • {"requestId":"f3c2481a7fbfa","workspaceId":1,
    "uri":"/typo3/index.php?route=/ajax/page/tree/fetchData&token=1d0842ee19f7c32ce12437576cd93d92d5194c30"}
Actions #5

Updated by Oliver Hader over 4 years ago

  • setWorkspace falls back to previous workspace since $this->groupData['workspace_perms'] is not defined
  • BackendUserAuthentication->fetchGroupData() - which will define $this->groupData['workspace_perms'] - is called afterwards (too late)
Actions #6

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64264

Actions #7

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64264

Actions #8

Updated by Gerrit Code Review over 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64264

Actions #9

Updated by Gerrit Code Review over 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64264

Actions #10

Updated by Benni Mack over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF