Project

General

Profile

Actions

Bug #99049

closed

Forwarding with Extbase ForwardResponse to a different Controller only works by assigning ControllerAlias (Followup #91671)

Added by Garvin Hicking over 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2022-11-10
Due date:
% Done:

0%

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

Description

Hi,

I hit the same bug as described in #91671 which was recently closed. I was advised to open a new issue.

I'd argue that it is a core bug, that a forwardResponse to a different controller only works by using the workaround:

$this->request->setControllerAliasToClassNameMapping (
  ['Controllername' => 'Vendorname\ExtensionName\Controller\ControllernameController']
);

I tried to use all these three variants:

return (new ForwardResponse('actionname'))
  ->withControllerName('Controllername')
  ->withExtensionName('ExtensionName');
return (new ForwardResponse('actionname'))
  ->withControllerName('Vendorname\ExtensionName\Controller\ControllernameController')
  ->withExtensionName('ExtensionName');
return (new ForwardResponse('actionname'))
  ->withControllerName(Vendorname\ExtensionName\Controller\ControllernameController::class)
  ->withExtensionName('ExtensionName');

I'd argue, using any of these last two should work without the need of accessing setControllerAliasToClassNameMapping?

If it is intended behavior, please let me know, then I can issue a PR for the documentation to document the need of using this method when forwarding to another action. The current version of the documentation at https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ExtensionArchitecture/Extbase/Reference/Controller/ActionController.html#forward-to-a-different-controller doesn't address it (btw it contains a small optical issue and uses (('Blog')) instead of ('Blog') ).

Thanks for your work
Garvin


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101824: RedirectReponse to another Controller missing controllerObjectNameClosed2023-09-01

Actions
Actions #1

Updated by Garvin Hicking 9 months ago

  • Related to Bug #101824: RedirectReponse to another Controller missing controllerObjectName added
Actions #2

Updated by Garvin Hicking 8 months ago

Solved via Documentation update: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/3400

Duplicate of #101824 - the underlying issue was a misconfiguration of not providing the FQCN of allowed action/controller pairs within the extension configuration.

Actions #3

Updated by Mathias Brodala 8 months ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF