Bug #104320
openBroken page rendering with PropagateResponseException from extbase
0%
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 ❌