#109532Derive workspace preview handling from event context
Description
The workspace hook in typo3/sysext/workspaces/Classes/Hook/BackendUtilityHook.php decides early whether preview URI processing is
needed. Reading the workspace from the event context makes that
decision depend on the current preview state instead of the backend
user object.
Reviews 2
History 46
-
Gerrit Code Review pushed patch set 1 for main to change 93603 status
NewUnder Review <span data-processor="relativetime" data-value="2026-04-09T15:28:31+00:00" > 04/09/26, 15:28 </span> -
Matthias Vogel commented <span data-processor="relativetime" data-value="2026-04-13T08:35:12+00:00" > 04/13/26, 08:35 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2026-04-13T10:41:33+00:00" > 04/13/26, 10:41 </span>
note: this came up with ext:visual_editor, where the view module needs to get a preview without triggering the workspace split view.
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93639 <span data-processor="relativetime" data-value="2026-04-13T11:13:21+00:00" > 04/13/26, 11:13 </span>
-
Matthias Vogel commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-04-13T11:35:09+00:00" > 04/13/26, 11:35 </span>Applied in changeset commit:bfac1c8848d8a5ad85d04076c06085e5721325fd.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-04-21T11:30:36+00:00" > 04/21/26, 11:30 </span>
Background
TYPO3 Core provides
PreviewUriBuilderto generate frontend preview URLs for pages, including workspace-aware previews. Extensions may use this API when they need to embed or load a regular frontend preview.In this case, the extension expects a plain frontend preview URL, not a workspace compare or split preview. However, preview URL generation is still affected by the active backend workspace of the current user.
The problem becomes visible in code like this:
An extension may try to avoid workspace influence by explicitly building the URI with a context that has no workspace aspect:
However, this is currently not sufficient in all cases, because workspace state is still effectively derived from the backend user.
As a workaround, extensions currently need to temporarily reset
$GLOBALS['BE_USER']->workspacebefore callingbuildUri():From a Core perspective, this indicates that PreviewUriBuilder is not yet fully isolated from backend user workspace state.
Expected behavior
When an extension calls
PreviewUriBuilderwith a context where the workspace aspect has been removed, TYPO3 Core should generate a plain frontend preview URL only.Passing a workspace-neutral context should be sufficient to guarantee that no active backend workspace is applied implicitly. Preview URL generation should be deterministic and should not depend on
$GLOBALS['BE_USER']->workspacewhen an explicit context is provided.