Review main Merged

89997[BUGFIX] Avoid switching workspace in PreviewController

Christian Kuhn CR +2 V +2 Easy +3 −18 updated 07/08/25, 14:12

Commit message

The "slider" workspace PreviewController has an odd functionality
that can force the backend user into a different workspace when
reloading a given preview using the "previewWS" GET parameter. This
leads to inconsistent UI.

Suppose the following scenario:
* Have two workspaces, one having an additional custom stage.
* Have a live page with a content element.
* Go to workspace 1, change the content element.
* Use the BE workspace module list and click the "eye" to
  preview the change of the element. Leave that tab open.
* Go to workspace 2, change the content element differently.
* Reload the still open tab.
* Call the BE workspace module again.

Result:
* The reloaded preview still shows the changes from workspace 1.
* The "next" stage from workspace 2 is used in the preview, even
  though content changes from workspace 1 are renedered.
* The BE workspace module "magically" switches to workspace 1
  when called again.
* The BE page tree is still workspace 2, and the toolbar workspace
  selector still shows workspace 2, too. This only switches to
  workspace 1 when the BE is reloaded.

To overcome this weird behavior, we fully remove the 'previewWS'
GET argument: The PreviewController no longer forces a BE user
into some workspace to avoid an inconsistent BE afterwards. When
reloading an open preview tab, the preview now simply uses the
current selected workspace of the backend user, and no longer tries
to show content from a different workspace a BE user may have switched
away from meanwhile.

Note the links from the PreviewController can not be "shared" by
sending them to a different user: The PreviewController is a BE
module controller and as such bound to the browser session. Sharing
workspace previews can only be done using the "Generate Page Preview
Links" functionality. Thus, changing the PreviewController arguments
by leaving out 'previewWS' only impacts the given local browser
session and user.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
    • Jochen Roth +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 56

  1. Christian Kuhn uploaded patch set 1 07/06/25, 15:31

  2. core-ci voted on patch set 1 V +1 07/06/25, 15:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81378

  3. Benjamin Franzke voted on patch set 1 CR +1 V +1 07/08/25, 10:32

  4. Jochen Roth voted on patch set 1 CR +1 V +1 07/08/25, 12:55

  5. Christian Kuhn voted on patch set 1 CR +2 V +2 07/08/25, 14:12

  6. Christian Kuhn merged patch set 2 07/08/25, 14:12