#106908Workspace Preview generates wrong URL for Live page
Description
- In a workspace, change the URL segment of a page
- Use the “View” button to open the Preview offering a slider to compare the live version with the workspace version.
- The live version shows a page not found error
That is because the PreviewController tries to generate the $liveUrl while the Context is still set to a workspace.
$liveUrl = $this->generateUrl($site, $pageUid, $parameters);
needs to be changed to
// temporarily set workspace aspect to live (0) to generate the live URL
$wsAspectBackup = $this->context->getAspect('workspace');
$this->context->setAspect('workspace', new WorkspaceAspect(0));
$liveUrl = $this->generateUrl($site, $pageUid, $parameters);
$this->context->setAspect('workspace', $wsAspectBackup);
I observed the issue in TYPO3 v13 and v12 and from looking at the code it’s present in v14 as well.
Reviews 2
History 38
-
Gerrit Code Review pushed patch set 1 for main to change 89758 status
NewUnder Review <span data-processor="relativetime" data-value="2025-06-18T13:42:38+00:00" > 06/18/25, 13:42 </span> -
Garvin Hicking changed category <span data-processor="relativetime" data-value="2025-06-18T13:55:59+00:00" > 06/18/25, 13:55 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 89758 <span data-processor="relativetime" data-value="2025-08-14T09:35:47+00:00" > 08/14/25, 09:35 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 89758 <span data-processor="relativetime" data-value="2025-08-14T09:43:25+00:00" > 08/14/25, 09:43 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 90393 <span data-processor="relativetime" data-value="2025-08-14T10:09:31+00:00" > 08/14/25, 10:09 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 90393 <span data-processor="relativetime" data-value="2025-08-14T10:10:14+00:00" > 08/14/25, 10:10 </span>
-
Sebastian Michaelsen commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-08-14T10:15:08+00:00" > 08/14/25, 10:15 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:21:27+00:00" > 12/02/25, 14:21 </span>
Applied in changeset commit:4ea7cd386fa8cdc2e8064d3fb05e0df0fe91a42e.