Review main Ready for review Quiet

96732[BUGFIX] Follow redirects of page content error pages

Benni Mack CR 0 V 0 Normal +132 −5 updated 10/30/26, 21:32

Commit message

An error page configured via errorContentSource that answered the
sub-request with a redirect made the error handler throw instead of
delivering the error page. This happened for shortcut pages, mount
points, EXT:redirects records and custom middlewares redirecting the
error page URL.

Redirects are now followed with further sub-requests, up to five
times, as long as the target is served by a site of this instance and
has not been requested before. As the frontend resolves each target,
site and language are handled as for any other request.

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 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/32/96732/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/32/96732/2 && git cherry-pick FETCH_HEAD

Review

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

Merge conflicts 1

Issues 1

Files 5

Review log 57

  1. Benni Mack uploaded patch set 1 10/15/26, 16:55

  2. Wouter Wolters voted on patch set 1 CR +1 V +1 10/15/26, 17:07

  3. core-ci voted on patch set 1 V +1 10/15/26, 17:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111244

  4. Oli Bartsch commented on patch set 1 10/29/26, 22:21

    the issue reports a custom middleware answering the error page URL with a 307, and that case still throws 1544172839 with this patch. The same goes for mount points with `mount_pid_ol`, link pages to external URLs and EXT:redirects records.

    PageContentErrorHandler.php:136

    the shortcut is resolved with the main request's language, but `resolveUrl()` picks the error page language later. Since `pages.shortcut` and `doktype` are translatable, a translated shortcut can lead to the wrong target or still produce the 307. We could determine the language first and use `PageRepository::withLanguageAspect()`. WDYT?
  5. Benni Mack uploaded patch set 2 CR +1 V +1 10/30/26, 16:45

  6. core-ci voted on patch set 2 V +1 10/30/26, 16:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112893

  7. Benni Mack commented on patch set 2 10/30/26, 21:32

    Reply

    now fixed.

    PageContentErrorHandler.php:136 Reply

    I took a different approach now, which adapts to the process of the one in the ticket (not just shortcuts).