Project

General

Profile

Actions

Bug #104320

open

Broken page rendering with PropagateResponseException from extbase

Added by Torben Hansen 5 months ago. Updated about 1 month ago.

Status:
Accepted
Priority:
Must have
Assignee:
-
Category:
Extbase
Start date:
2024-07-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 by ErrorController->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 ❌


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #95174: pageNotFoundAction not working properly in Extbase with feature toggle subrequestPageErrors turned onClosed2021-09-10

Actions
Is duplicate of TYPO3 Core - Bug #103215: PageContentErrorHandler attaches error output to current response's output instead of replacing it.Under Review2024-02-27

Actions
Actions

Also available in: Atom PDF