Merge conflict

Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress

98323[TASK] Add one frame component for the preview frames of the backend

Matthias Vogel CR 0 V 0 Hard +544 −68 updated 12/04/26, 10:25

Commit message

This patch adds an internal API for the frames of the backend that
show frontend pages. It has two parts: the PHP class
PreviewFrameFactory and the TypeScript module
@typo3/backend/preview/preview-frame. The new PHP classes are marked
@internal. Later patches for #110664 use the component:

* "[BUGFIX] Renew the preview token of the frame" adds the frame with
  a preview token to PreviewFrameFactory::create() and the token mode
  to PreviewFrame, for the frame of ViewModuleController.
* "[BUGFIX] Open the backend preview page for sites without backend
  cookie" shows the frame of PreviewPageController::showAction()
  through PreviewFrameFactory::create() and PreviewFrame in
  preview-page.ts.
* "[BUGFIX] Use preview tokens in the frames of the workspace preview"
  adds the frames with a preview token to the workspace
  PreviewController.

97700 "[BUGFIX] Allow workspace preview frames on other site hosts"
(#110312) is merged. It added the origins of the workspace preview
frames to `frame-src`. This patch moves that code into
PreviewFrameFactory.

It is chained on top of "[BUGFIX] Preview hidden pages across site
domains". The frame of ViewModuleController keeps the address with
the preview token of that patch. Without a token, it gets its
settings from PreviewFrameFactory::create(). Merge the patches below
it in the chain first, then this patch.

The module "Content > Preview" and the workspace preview show frontend
pages in frames. Each controller built the address of its frame and
its rule for `frame-src` in its own way. 97700 gives the workspace
preview a copy of this code.

The new class PreviewFrameFactory is the one entry point for these
frames. It returns the typed settings of a frame and allows the origin
of the page in `frame-src` of the current response. The TypeScript
module @typo3/backend/preview/preview-frame reads these settings,
loads the frame and loads it again on request. The Preview module and
the workspace preview now use both parts. The behaviour of the frames
does not change.

The script of the Preview module also had a click handler for a
refresh button that does not exist since #108008. The handler looked
for a frame with a wrong id. This change removes the handler. The
reload button of the module header reloads the module and its frame,
as before.

The templates of both frames change. A frame gets its address from
the attribute `data-preview-settings` and no longer from `src`. The
template of the Preview module no longer gets the variable `{url}`.
The template of the workspace preview no longer gets `{wsUrl}`. A
template that overrides one of them with the page TSconfig option
`templates` must take over this change. The core does not treat
backend templates as API, see the changelog entry of #96812. Thus
this patch has no changelog entry. The later patches "[BUGFIX] Renew
the preview token of the frame" and "[BUGFIX] Use preview tokens in
the frames of the workspace preview" describe the two templates in
the changelog entry of #110664.
Show more Show less
Resolves: #TBD
Related: #110664
Releases: main, 14.3
Change-Id: I2eeae994dc85a59b5d9d891322ac04678424cab5

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/98323/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/23/98323/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 16

  1. 98329[BUGFIX] Use preview tokens in the frames of the workspace preview Based on this change Matthias Vogel → main, 14.3 Hard +580 −55 CR 0 V 0 Work in progress Merge conflict
  2. 98328[TASK] Add a live view kind of preview token Based on this change Matthias Vogel → main, 14.3 Hard +771 −73 CR 0 V 0 Work in progress Merge conflict
  3. 98327[BUGFIX] Follow the page of the preview frame in the backend Based on this change Matthias Vogel → main, 14.3 Expert +1225 −114 CR 0 V -1 Work in progress Merge conflict
  4. 98326[BUGFIX] Keep the preview token in navigations that scripts start Based on this change Matthias Vogel → main, 14.3 Hard +922 −4 CR 0 V 0 Work in progress Merge conflict
  5. 98325[BUGFIX] Keep the preview token in links, forms and redirects Based on this change Matthias Vogel → main, 14.3 Hard +828 −38 CR 0 V 0 Work in progress Merge conflict
  6. 98324[BUGFIX] Renew the preview token of the frame Based on this change Matthias Vogel → main, 14.3 Expert +1634 −63 CR 0 V 0 Work in progress Merge conflict
  7. 98323 [TASK] Add one frame component for the preview frames of the backend This change

  8. 97235[BUGFIX] Preview hidden pages across site domains This change is based on it Matthias Vogel → main, 14.3 Hard +467 −10 CR 0 V 0 Work in progress Merge conflict 19 unresolved
  9. 98322[TASK] Accept preview tokens in the frontend This change is based on it Matthias Vogel → main, 14.3 Expert +1994 −4 CR 0 V 0 Work in progress Merge conflict
  10. 98321[TASK] Issue preview tokens in the backend This change is based on it Matthias Vogel → main, 14.3 Hard +880 −1 CR 0 V 0 Work in progress Merge conflict
  11. 98320[TASK] Check where a request with a preview token comes from This change is based on it Matthias Vogel → main, 14.3 Hard +934 −1 CR 0 V 0 Work in progress Merge conflict
  12. 98319[BUGFIX] Handle query parameters of links in one place This change is based on it Matthias Vogel → main, 14.3 Hard +435 −20 CR 0 V 0 Work in progress
  13. 98318[TASK] Resolve the sites and hosts a backend user may preview This change is based on it Matthias Vogel → main, 14.3 Hard +700 −0 CR 0 V 0 Work in progress
  14. 98317[TASK] Sign and verify preview tokens This change is based on it Matthias Vogel → main, 14.3 Hard +625 −0 CR 0 V -1 Work in progress Merge conflict
  15. 98316[TASK] Add typed claims for preview tokens This change is based on it Matthias Vogel → main, 14.3 Hard +530 −0 CR 0 V -1 Work in progress
  16. 98315[TASK] Add a read-only backend user for one workspace This change is based on it Matthias Vogel → main, 14.3 Expert +1719 −2 CR 0 V 0 Work in progress

    The chain has patch set 1 of 2, the changes above it need a rebase.

Issues 1

Files 17

Review log 23

  1. Matthias Vogel uploaded patch set 1 12/04/26, 09:02

  2. core-ci voted on patch set 1 V +1 12/04/26, 09:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116308

  3. Matthias Vogel wrote 12/04/26, 10:25

    Topic set to cross-domain-preview