Bug #83547
closedpreviewLinks in Workspaces and broken rootline
100%
Description
What I did
- Creating a previewlink in workspace modul
- Open this link in browser http://localhorst/index.php?&ADMCMD_prev=a3cc578bead68b529839d34dd85a96e4&id=XXX
Actually result
TYPO3 Exception
Broken rootline. Could not resolve page with uid XXX
Awaited result
Showing a preview of the site defined in the preview link.
--
- We need two workspaces, which need to have different "db_mountpoints" defined, without overlapping rootline
- Switch to workspace one
- Create a new page
- Create a previewlink for this new page in the workspace modul.
- Test previewlink in another browser => Works
- Switch to workspace two
- Test previewlink in another browser => Exception
Updated by Alexander Opitz almost 7 years ago
The problem is inside
/typo3/sysext/workspaces/Classes/Hook/PreviewHook.php:140 ff
// Either use configured workspace mount (of the workspace) or current page id if (empty($tempBackendUser->groupData['webmounts'])) { $tempBackendUser->groupData['webmounts'] = !empty($workspaceRecord['db_mountpoints']) ? $workspaceRecord['db_mountpoints'] : $pObj->id; }
The $tempBackendUser->groupData['webmounts'] will contain the webmounts of the BE user who generated this preview link, so if he switched to another workspace with db_mountpoints out of the scope of our page to view, we are off.
But removing this line may lead to a security issue, if the db_mountpoints of the be_user is deeper then the one of the workspace ... he could then see pages out of his scope inside the preview.
We could add, before calling $tempBackendUser->fetchGroupData(); something like
$tempBackendUser->user['workspace_id'] = $workspaceUid;
but the function fetchGroupData() calls workspaceInit() which may lead to workspace change on user record.
Maybe it helps todo before $tempBackendUser->fetchGroupData(); (but it is a bit fragile IMHO):
$tempBackendUser->setTemporaryWorkspace($workspaceUid); $tempBackendUser->user['workspace_id'] = $workspaceUid;
Updated by Gerrit Code Review almost 7 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/55341
Updated by Gerrit Code Review almost 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55613
Updated by Gerrit Code Review almost 7 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/55341
Updated by Gerrit Code Review almost 7 years ago
Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55613
Updated by Alexander Opitz almost 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d7c8f29104d2e03db64f790fe18ef520f055c513.