#104320Broken page rendering with PropagateResponseException from extbase
Description
When the reponse object from a ErrorController->pageNotFoundAction is thrown from an extbase action, page rendering is broken, if a 404 page error handler is configured. Instead of showing the content of the 404 page, the output containts 2 body tags mixed up with content from the original page and the configured 404 error page.
Prerequisites:
- TYPO3 page with a 404 page error handler, which shows the content of a page. The error page should at least contain a content element with some text.
- Extbase plugin with one action. Action must throw a
PropagateResponseException, containing a Response-Object generated byErrorController->pageNotFoundAction– see example below
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$this->request,
'Exit from action'
);
throw new PropagateResponseException($response, 1720242346);
How to reproduce
1. Create a new page named “Extbase Plugin“
2. Insert a “Regular Text Element” content element on the page and fill out header and add some text
3. Insert the extbase plugin on the page
4. Flush the TYPO3 cache
5. Open a non existing URL -> The configured 404 page content is shown ✅
6. Open the page with the extbase plugin -> The content of the configured 404 page is shown ✅
7. Flush the TYPO3 cache
8. Open the page with the extbase plugin -> The content (created in step 2) of the page “Extbase Plugin” is shown and additionally, the content of the 404 page. HTML output has 2 body tags . ❌
9. Open a non existing URL -> Same af for step 8 – 404 page seems to be cached wrong ❌
Reviews 3
Related issues 1
History 6
-
Christian Kuhn changed Related to #95174 <span data-processor="relativetime" data-value="2024-07-06T12:07:26+00:00" > 07/06/24, 12:07 </span>
-
Georg Ringer changed Duplicates #103215 <span data-processor="relativetime" data-value="2024-07-07T08:17:56+00:00" > 07/07/24, 08:17 </span>
-
Georg Ringer changed status
NewAccepted <span data-processor="relativetime" data-value="2024-07-11T11:55:29+00:00" > 07/11/24, 11:55 </span> -
Garvin Hicking changed category <span data-processor="relativetime" data-value="2024-07-31T08:58:55+00:00" > 07/31/24, 08:58 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2024-10-15T08:19:06+00:00" > 10/15/24, 08:19 </span>
-
Torben Hansen commented and changed status
AcceptedResolved <span data-processor="relativetime" data-value="2026-08-25T08:35:52+00:00" > 08/25/26, 08:35 </span>
Applied in changeset commit:119866d287afb6a06134d0fbe181762e78192fc3.