Project

General

Profile

Actions

Bug #90422

closed

ActionController::redirect() without action argument causes exception in master

Added by Christian Eßl almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2020-02-18
Due date:
% Done:

100%

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

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)
Actions #1

Updated by Christian Eßl almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Christian Eßl almost 5 years ago

  • Description updated (diff)
Actions #3

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

Actions #4

Updated by Georg Ringer over 4 years ago

  • Target version set to 10 LTS
Actions #5

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

Actions #6

Updated by Christian Eßl over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF