Review 14.3 Merged

97815[BUGFIX] Fix workspace split preview URLs for access-restricted pages

Benni Mack CR +2 V +2 Hard +432 −26 updated 11/19/26, 09:03

Commit message

Two issues affected the draft URL in the workspace split preview:

1) The draft URL always resolved to the site root instead of the
correct page path when the page had an fe_group restriction. The
draft URL was generated using workspace context (workspace > 0),
which caused PageRepository::getPage() to invoke versionOL(). Inside
versionOL(), getWorkspaceVersionOfRecord() runs an enable-fields check
via FrontendRestrictionContainer. In a backend context there is no
frontend user, so FrontendGroupRestriction only permits pages where
fe_group is empty or '0'. Any other restriction caused the check to
return -2, versionOL() set $row to false, getPage() returned an empty
array, and the generated URL path became '/' (site root).

The live URL was unaffected because it already used an explicit
workspace=0 context which causes versionOL() to return immediately
without any enable-fields checks. The draft URL keeps the workspace
context, so slugs changed or created in the workspace, e.g. of a
translation that only exists there, are still used. Instead, the
simulated frontend user groups are now set on the context, so the
draft version passes FrontendGroupRestriction. The group -2 ("show at
any login") is added as well, as any logged-in frontend user has it.

2) When a page's live and workspace versions are protected by different
fe_groups (e.g. fe_group=1 in live, fe_group=2 in workspace), the
draft URL produced either a 403 or a 404. The frontend checks the
restriction of the live page record, and versionOL() then checks the
restriction of the workspace version overlaying it. The simulated
frontend user set by ADMCMD_simUser must therefore satisfy both
restrictions. The PreviewController now merges both group ID lists
for the draft URL.

PreviewSimulator::simulateUserGroup() previously only accepted a
single integer group ID. It now accepts a comma-separated list so the
merged group set can be passed via a single ADMCMD_simUser parameter.
The fe_user usergroup_column is a comma-separated varchar field and
FrontendGroupRestriction uses FIND_IN_SET(), so multiple groups are
natively supported at the database level.

The admin panel reads ADMCMD_simUser as well and now simulates every
group of the list instead of only the first one. Its middleware is now
declared to run before the preview simulator, so the preview parameters
take precedence over the admin panel settings.

The new internal PreviewSimulatorCalculator in EXT:frontend converts
between the ADMCMD_simUser parameter and group IDs, and is used by
PreviewSimulator, the admin panel and PreviewController.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 10

Review log 34

  1. Benni Mack uploaded patch set 1 11/19/26, 08:25

  2. core-ci voted on patch set 1 V +1 11/19/26, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114972

  3. Benni Mack voted on patch set 1 CR +2 V +2 11/19/26, 09:03

  4. Benni Mack merged patch set 2 11/19/26, 09:03