Review main Merged

91127[BUGFIX] Reset page renderer when performing subrequest

Torben Hansen CR +2 V +2 Normal +163 −18 updated 08/25/26, 08:31

Commit message

The `PageContentErrorHandler` renders a configured error page through an
internal subrequest. That subrequest reuses the `PageRenderer`
singleton, which still carries the state of the request that failed:
header data, footer data, JavaScript, CSS and inline assets of the
requested page end up in the error page and are cached with it.

The `PageRenderer` state is therefore reset before the subrequest runs.
`PageRenderer->reset()` is public and marked `@internal` now, so the
error handler can reach it.

A functional test covers an uncached plugin that answers with the 404
page and asserts that none of the requested page's state survives into
it. Three tests in `SiteRequestTest` covering the page based error
handler were skipped because the handler used to fetch the error page
over HTTP. Internal subrequests have been the default since v12, so
these tests are enabled again and now assert the rendered error page
instead of the status code alone.

This is an intermediate fix until subrequests stop sharing state with
the request they answer.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
    • core-ci +1 CI

Issues 2

Files 8

Review log 3040

Show 1115 earlier messages
  1. Torben Hansen uploaded patch set 1 10/17/25, 13:39

  2. core-ci voted on patch set 1 V -1 10/17/25, 13:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86907

  3. Torben Hansen uploaded patch set 2 V -1 10/17/25, 13:51

  4. core-ci voted on patch set 2 V +1 10/17/25, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86908

  5. Oliver Klee voted on patch set 2 CR +1 12/08/25, 20:15

  6. Torben Hansen updated the commit message in patch set 3 CR +1 V +1 12/09/25, 06:38

  7. core-ci voted on patch set 3 V +1 12/09/25, 06:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91862

  8. Torben Hansen updated the commit message in patch set 4 V +1 12/09/25, 07:59

  9. core-ci voted on patch set 4 V +1 12/09/25, 08:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91863

  10. Oliver Klee voted on patch set 4 CR +1 12/09/25, 08:21

  11. Oliver Klee commented on patch set 4 12/09/25, 08:59

    Is there any way this can be covered with a functional test?
  12. Torben Hansen commented on patch set 4 12/09/25, 18:38

    Reply

    For functional test I would say no. Acceptance test would be an option, but requirements are pretty high (see issue description: page error handler, uncached extbase plugin which throws a `PropagateResponseException`, special request order in test execution, check for duplicate `body` tag). Adding this test scenario would however only make sense for me, if the patch is the right approach and a missing test is the only blocker for a merge.
  13. Oliver Klee commented on patch set 4 12/09/25, 18:45

    Reply

    Ack.
  14. Christian Weiske commented on patch set 4 CR +1 V +1 01/12/26, 09:44

    I can confirm that this patch works on 12.4.40 as long as `bodyContent` is reset in `PageRenderer::reset()` as well. (This is missing in 12.4, and was added to v13 in "Harden array callbacks in EXT:core, part 3", commit 734a9a849411c34a714cd3445940d34e41d77974)
  15. Simon Schaufelberger voted on patch set 4 CR +1 V +1 01/26/26, 08:41

  1. Georg Ringer voted on patch set 4 CR +1 03/04/26, 20:06

  2. Jörg Bösche voted on patch set 4 CR +1 V +1 03/25/26, 16:04

  3. Simon Schaufelberger uploaded patch set 5 CR +1 V +1 03/30/26, 20:06

  4. core-ci voted on patch set 5 V -1 03/30/26, 20:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99115

  5. Benni Mack updated the commit message in patch set 6 V -1 04/22/26, 06:44

  6. core-ci voted on patch set 6 V -1 04/22/26, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100780

  7. Oliver Klee commented on patch set 6 CR +1 05/03/26, 08:30

    (Needs a rebase and conflict resolution, though.)
  8. Simon Schaufelberger uploaded patch set 7 CR +1 V -1 05/09/26, 18:20

  9. core-ci voted on patch set 7 V -1 05/09/26, 18:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101758

  10. Christian Kuhn wrote 06/18/26, 23:07

    Removed reviewer Christian Kuhn.
  11. Simon Schaufelberger uploaded patch set 8 V -1 06/21/26, 11:45

  12. core-ci voted on patch set 8 V +1 06/21/26, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103696

  13. Simon Schaufelberger voted on patch set 8 CR +1 V +1 06/21/26, 11:53

  14. Oliver Klee voted on patch set 8 CR +1 06/21/26, 19:38

  15. Benjamin Kott uploaded patch set 9 CR +1 V +1 08/24/26, 18:20

  16. Benjamin Kott commented on patch set 9 08/24/26, 18:21

    i´ve added the missing tests and also reenabled the site request tests
  17. Benjamin Kott voted on patch set 9 CR +1 V +1 08/24/26, 18:21

  18. core-ci voted on patch set 9 V +1 08/24/26, 18:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107046

  19. Georg Ringer voted on patch set 9 CR +1 V +1 08/24/26, 18:55

  20. Benjamin Franzke uploaded patch set 10 CR +1 V +1 08/25/26, 07:13

  21. Benjamin Kott voted on patch set 10 CR +1 V +1 08/25/26, 07:14

  22. core-ci voted on patch set 10 V +1 08/25/26, 07:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107072

  23. Benjamin Franzke commented on patch set 10 08/25/26, 07:31

    ack, voting this as a hack for the state we have 😊
  24. Benjamin Kott voted on patch set 10 CR +2 V +2 08/25/26, 07:33

  25. Benjamin Kott merged patch set 11 08/25/26, 08:31