Project

General

Profile

Actions

Bug #100363

closed

Using a PropagateResponseException (for 404) in controller action displays Fluid error instead of 404 page since v12

Added by Chris Müller over 1 year ago. Updated 10 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-03-31
Due date:
% Done:

0%

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

Description

I am using this code in an Extbase show controller action to propagate the configured 404 page when a particular condition in the given model is not matched:

$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
    $this->request,
    'The requested product does not exist',
    [
        'code' => PageAccessFailureReasons::PAGE_NOT_FOUND,
    ],
);
throw new PropagateResponseException($response, 1615293813);

This works like expected in TYPO3 v11.5: The 404 page configured in the site configuration is displayed.

However, with v12.3 the following error is displayed instead of the 404 page:

Tried resolving a template file for controller action "Show->show" in format ".html", but none of the paths contained the expected template file (Show/Show.html). The following paths were checked: /var/www/html/vendor/myvendor/site/Resources/Private/Templates/Page/

with status code 500.

It looks like the subrequest(?) wants to use the Show template of the action for some reason (and looks for it in the folder for the page templates).

Actions #1

Updated by Benni Mack about 1 year ago

  • Target version changed from 12 LTS to Candidate for patchlevel
Actions #2

Updated by Benni Mack about 1 year ago

  • Status changed from New to Needs Feedback

I guess you'd rather want a ImmediateResponseException?

Actions #3

Updated by Torben Hansen 11 days ago

I'm not able to reproduce to problem. Works for me in v12 and v13.

Actions #4

Updated by Riccardo De Contardi 10 days ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (Candidate for patchlevel)

I think it's safe to close this issue as solved (comment 3)
If you think that this is the wrong decision or experience the issue again, please reopen it or ping me on Slack and I'll do it.

Thank you.

Actions

Also available in: Atom PDF