Bug #93097
closedFaulty live view in comparison preview for non LIVE-Editors
100%
Description
In Version TYPO3 10.4.10 there is a problem in the comparison view for editors without LIVE-editing permissions. You can reproduce the error as follows:
- Login as an editor without LIVE-editing permissions
- Switch to a workspace
- Edit an existing content element (e.g. Text) with some text
- Open the preview of the page
- Use the slider to compare the workspace version with de live version
Actual behaviour:
The live version displays changed element even thoug it hasn't been published yet. The view is correct when you open the comparison with an editor who has LIVE-editing permissions.
Expected behaviour:
The text change should only be visible in the draft version and not in the live view when using the slider.
Updated by Oleg Karun almost 4 years ago
Uwe Trotzek wrote:
In Version TYPO3 10.4.10 there is a problem in the comparison view for editors without LIVE-editing permissions. You can reproduce the error as follows:
- Login as an editor without LIVE-editing permissions
- Switch to a workspace
- Edit an existing content element (e.g. Text) with some text
- Open the preview of the page
- Use the slider to compare the workspace version with de live version
Actual behaviour:
The live version displays changed element even thoug it hasn't been published yet. The view is correct when you open the comparison with an editor who has LIVE-editing permissions.Expected behaviour:
The text change should only be visible in the draft version and not in the live view when using the slider.
Same for me TYPO3 10.4.12
Updated by Riccardo De Contardi almost 4 years ago
- Related to Bug #93371: TYPO3 10.4.x workspaces user without permission " Edit live (Online)" also dont see Live version in Preview. Bug? added
Updated by Roman Stulz over 3 years ago
Hi all
I actually have the same issue with v10.4.13
Are there an updates related to this bug?
Thank you!
Updated by Lidia Demin almost 3 years ago
Can confirm this problem on TYPO3 10.4.22. Might this be related to #96077?
Updated by Eric Harrer over 2 years ago
Same issue in version 10.4.30
I've gotten a little more into that now.
The relevant part is in file EXT:workspaces/Classes/Middleware/WorkspacePreview.php on line 118 in function WorkspacePreview->process():
// If keyword is set to "LIVE", then ensure that there is no workspace preview, but keep the BE User logged in. // This option is solely used to ensure that a be user can preview the live version of a page in the // workspace preview module. if ($keyword === 'LIVE' && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) { // We need to set the workspace to live here $GLOBALS['BE_USER']->setTemporaryWorkspace(0); /* < this includes a check for the current groups workspace_perms */ // Register the backend user as aspect $this->setBackendUserAspect($context, $GLOBALS['BE_USER']); // Caching is disabled, because otherwise generated URLs could include the keyword parameter $request = $request->withAttribute('noCache', true); $addInformationAboutDisabledCache = true; $setCookieOnCurrentRequest = false; }
If I put the line
$GLOBALS['BE_USER']->groupData['workspace_perms'] = 1;
before line
$GLOBALS['BE_USER']->setTemporaryWorkspace(0);
the problem is solved.
since at this point, regardless of the "workspace_perms" setting of the current backend user group, the live workspace should be displayed, I would say that this is a useful workaround. What do you think?
For the moment I have solved this by XCLASSing \TYPO3\CMS\Workspaces\Middleware\WorkspacePreview.
Enter the following in ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Workspaces\Middleware\WorkspacePreview::class] = [ 'className' => \VendorName\PackageName\Middleware\WorkspacePreview::class ];
and create the following class under EXT:package_name/Classes/Middleware/WorkspacePreview.php
<?php namespace VendorName\PackageName\Middleware; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Backend\FrontendBackendUserAuthentication; class WorkspacePreview extends \TYPO3\CMS\Workspaces\Middleware\WorkspacePreview { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $keyword = $this->getPreviewInputCode($request); if ($keyword === 'LIVE' && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) { $GLOBALS['BE_USER']->groupData['workspace_perms'] = 1; } return parent::process($request, $handler); } }
Updated by Gerrit Code Review over 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Nikita Hovratov over 2 years ago
- Has duplicate Bug #94829: Wrong workspace preview of published version if user has no access for live editing added
Updated by Nikita Hovratov over 2 years ago
- Related to Bug #34199: Navigating through 'Live' preview will load 'Workspace' version in 'Live' added
Updated by Gerrit Code Review about 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review about 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76272
Updated by Gerrit Code Review about 2 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review about 2 years ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review about 2 years ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74993
Updated by Gerrit Code Review about 2 years ago
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76272
Updated by Gerrit Code Review about 2 years ago
Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76272
Updated by Eric Harrer about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 86724c7f54437c4bf7df029e6801e538a86f4178.
Updated by Benni Mack almost 2 years ago
- Status changed from Resolved to Closed