Bug #90822

Parameter $controllerName in method uriFor of UriBuilder cannot be passed in a correct format

Added by Tobias Schmidt 7 months ago. Updated 6 months ago.

Should have
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Until TYPO3 9 the method uriFor required the parameter $controllerName to be passed in the format of the controller alias. That is the controller class name without the namespace and the Controller suffix. With change Deprecation: #87550 - Use controller classes when registering plugins/modules this does not work anymore because method \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin no longer accepts the class alias as array keys for parameters $controllerActions and $nonCacheableControllerActions. Instead it is neccessary to use the fully qualified controller class names.

This change leads to the following structure in $GLOBALS['TYPO3_CONF_VARS']:
EXTCONF -> extbase -> extensions ->MyExtension -> plugins -> MyPlugin -> controllers -> Vendor\MyExtension\Controller\MyWhateverController

If you call method uriFor of the UriBuilder with parameter $controllerName it passes the parameter to getPluginNameByAction of ExtensionService:

if ($pluginName === null && $this->environmentService->isEnvironmentInFrontendMode()) {
    $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controllerArguments['controller'], $controllerArguments['action']);

In method getPluginNameByAction in ExtensionService there is a comparison between the passed parameter $controllerName and the controller name from $GLOBALS['TYPO3_CONF_VARS']:

foreach ($plugins as $pluginName => $pluginConfiguration) {
    foreach ($pluginConfiguration['controllers'] ?? [] as $pluginControllerName => $pluginControllerActions) {
        if (strtolower($pluginControllerName) !== strtolower($controllerName)) {
        if (in_array($actionName, $pluginControllerActions['actions'], true)) {
            $pluginNames[] = $pluginName;

If you pass the class alias as parameter $controllerName in method uriFor the plugin name can never be set because the comparison always fails. If you pass the parameter $controllerName as fully qualified controller class name the comparison matches but the controller argument in the resulting link is wrong:

There is a mixup or inconsistency of using class alias and fully qualified class names that breaks the usage of parameter $controllerName in method uriFor of UriBuilder.

Associated revisions

Revision 115bff0a (diff)
Added by Alexander Schnitzler 7 months ago

[BUGFIX] Fix several methods of ExtensionService

Due to a missing functional test and a legacy extension
configuration format in a unit test several issues with
methods in the ExtensionService class have not been

Although the registration of plugins changed in that
manner that FQCN's are used instead of controller class
names, the internal handling in Extbase still relies on
controller names, which are internally named controller
aliases. The internal Extbase mechanics must still work
like before, passing the controller name around as this
is unique in the context of a plugin. Therefore it's not
necessary to expose or use the FQCN.

Releases: master
Resolves: #90822
Change-Id: Idd574bcbcddaa209337f73ad8526b2423ad9c786
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63933
Tested-by: TYPO3com <>
Tested-by: Toben Schmidt <>
Tested-by: Daniel Goerz <>
Reviewed-by: Toben Schmidt <>
Reviewed-by: Daniel Goerz <>


#1 Updated by Alexander Schnitzler 7 months ago

  • Assignee set to Alexander Schnitzler

#2 Updated by Alexander Schnitzler 7 months ago

  • Status changed from New to Accepted
  • Is Regression set to Yes

#3 Updated by Gerrit Code Review 7 months ago

  • Status changed from Accepted 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/+/63933

#4 Updated by Anonymous 7 months ago

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

#5 Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF