#110774PageContentErrorHandler subrequest reuse Extbase request
Description
In an Extbase action plugin, $this->request passed to pageNotFoundAction is an Extbase request, proxyfying the main request.
if (!$news instanceof News) {
$response = GeneralUtility::makeInstance(ErrorController::class)
->pageNotFoundAction(
$this->request,
LocalizationUtility::translate('error.404.message.default', 'Site'),
[
LocalizationUtility::translate('error.404.reasons.news.unavailabled', 'Site'),
]
);
throw new PropagateResponseException($response, 1724319487);
}
In PageContentErrorHandler::handlePageError , the request’s uri+query+method are enforced.
But no reset of the other attributes is performed, and the Extbase request’s attribute is therefore retained in the application’s sub-request.
$subRequest = $request
->withQueryParams([])->withUri(new Uri($resolvedUrl))
->withMethod('GET');
When the 404 page template is generated in `FluidTemplateContentObject`, the view contains the previous Extbase request in its `baseRenderingContext` property. The view is therefore generated with this context and the template is the plugin’s template, not the page template.
In our setup, the news detail template contains something that throw an Exception if there is no news (we can obsiously fix that, but that’s not the point).
The 404 page generation crash with an error, that gets cached.
Adding ->withoutAttribute('extbase') to the subRequest fixes the issue.
A workaround is to pass $GLOBALS['TYPO3_REQUEST'] to pageNotFoundAction , like before.
—
Since TYPO3 12, still an issue in v14.
Reviews 2
History 27
-
Rémy DANIEL changed description <span data-processor="relativetime" data-value="2026-09-24T13:30:02+00:00" > 09/24/26, 13:30 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 96119 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-28T05:42:52+00:00" > 09/28/26, 05:42 </span> -
Gerrit Code Review pushed patch set 2 for main to change 96119 <span data-processor="relativetime" data-value="2026-10-09T19:25:39+00:00" > 10/09/26, 19:25 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96577 <span data-processor="relativetime" data-value="2026-10-09T19:30:34+00:00" > 10/09/26, 19:30 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 96119 <span data-processor="relativetime" data-value="2026-10-09T19:36:14+00:00" > 10/09/26, 19:36 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 96577 <span data-processor="relativetime" data-value="2026-10-10T05:10:27+00:00" > 10/10/26, 05:10 </span>
-
Wolfgang Klinger commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-10T06:30:11+00:00" > 10/10/26, 06:30 </span>
Applied in changeset commit:773bb17b2f2e335d7539f115e64db7d464a71766.