Bug #90422
closedActionController::redirect() without action argument causes exception in master
100%
Description
Regression introduced with #87598.
ExtensionService::getPluginNameByAction() now requires the arguments as strings:
public function getPluginNameByAction($extensionName, string $controllerName, string $actionName): ?string
{
Both in ActionController::redirect() and UriBuilder::uriFor() you could (and can still) leave out all the arguments and make them null.
Before you could write a redirect like this, leaving out the action:
$this->redirect(
null, // $actionName
null, // $controllerName
null, // $extensionName
null, // $arguments
1
);
which would create a valid redirect to page 1. Now it will trigger the following error:
Argument 3 passed to TYPO3\CMS\Extbase\Service\ExtensionService::getPluginNameByAction() must be of the type string, null given, called in /var/www/html/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php on line 579
There are two options:
- Make the $actionName argument in ExtensionService of type ?string, preserving the old behaviour.
- Or change the ActionController::redirect() method to require giving it an action name. (Would have to be checked inside the method as the action can either be given in $actionName or $arguments)
Updated by Gerrit Code Review almost 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63291
Updated by Gerrit Code Review over 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63291
Updated by Christian Eßl over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset af5ce3d6765ac35e40b298f4267b712c7803b452.