Issue Bug Closed

#106908Workspace Preview generates wrong URL for Live page

Sebastian Michaelsen 06/18/25, 13:28 updated 12/02/25, 14:21

Description

How to reproduce:
  • 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

  1. Sebastian Michaelsen commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-08-14T10:15:08+00:00" > 08/14/25, 10:15 </span>

    Applied in changeset commit:4ea7cd386fa8cdc2e8064d3fb05e0df0fe91a42e.