Bug #101824
closedRedirectReponse to another Controller missing controllerObjectName
0%
Description
A follow-up to Issue #91671
In TYPO3v11 the workaround with `$this->request->setControllerAliasToClassNameMapping` did the trick to allow redirecting from one Controller-Action to another.
This stopped working with the stricter Extbase RequestInterface changes of https://github.com/typo3/typo3/commit/d70a4798904ca71406bc5530a8441dea16f39300
When doing this inside a controller:
```
return (new ForwardResponse('detail'))
->withControllerName('Mycontroller')
->withExtensionName('MyExtension');
```
this will create an object that is passed to `Extbase\Mvc\Dispatcher->resolveController` which is lacking the property
```
$request->attributes->extbase->controllerObjectName
```
This one is empty, and there's no setter available. The previous workaround with `setControllerAliasToClassNameMapping` is not available to pass a FQCN into the string, and then the exception occurs within the `resolveController()` method:
```
$controllerObjectName = $request->getControllerObjectName();
// will be empty string
$controller = $this->container->get($controllerObjectName);
// Dependency Injections dies, looks for a class called ""
```
The `Services.yaml` file for auto-configuration/auto-wiring provides Extbase with the existing Controllers. The Plugins providing these Controller do show up properly everywhere else, and call also be called by Middlewares.
The easiest workaround would be to re-introduce something like `->withControllerObjectName()` to the request object, but that might bypass stronger architectural groundwork.
It should be possible though to redirect to other Controllers, and the Documentation at https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/Extbase/Reference/Controller/ActionController.html#forward-to-a-different-controller should reflect that.
Will try to provide a simple extension to showcase the problem next week (and hope it really isn't related to some missing Extbase-Initialization/Service-Wiring).