Bug #91249

Two plugins calling the same action method

Added by Hagen Gebauer 25 days ago. Updated 13 days ago.

Status:
Closed
Priority:
Should have
Category:
Extbase
Start date:
2020-04-30
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

In my extension I have two plugins, both calling the show action method (ext_localconf.php):

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Vendor.researchgroups',
    'FieldList',
    [
        'Fields' => 'list, show'
    ]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Vendor.researchgroups',
    'FieldShow',
    [
        'Fields' => 'show'
    ]
);

This worked well in T3v9 – but in T3v10 I get the following error message in a content element where I call FieldList
(CType: list, list_type: researchgroups_fieldlist):

(1/1) #1280825466 TYPO3\CMS\Extbase\Exception

There is more than one plugin that can handle this request (Extension: "Researchgroups", Controller: "Fields", action: "show"). Please specify "pluginName" argument

The pluginName seems to be missing in TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder->uriFor():

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder->uriFor('show', array('fields' => 1, 'action' => 'show', 'controller' => 'Fields'), null, 'Researchgroups', null)

Additionally there’s the Configuration/TCA/Overrides/tt_content.php:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'researchgroups',
    'FieldList',
    'Research Groups: List of Research Fields'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'researchgroups',
    'FieldShow',
    'Research Groups: Selected Research Field'
);

When I remove the FieldShow plugin completely or rename the show action in its configuration, the error is gone.

I wouldn’t know in what way I could specify the pluginName other than through plugin registration and configuration and of course the selection in the content element.

Associated revisions

Revision 2f366190 (diff)
Added by Alexander Schnitzler 17 days ago

[BUGFIX] Fix detection of plugin name by action

While switching from controller class aliases to fully
qualified controller class names (internally), the structure
of framework configuration slightly changed.

This unfortunately broke the detection of the plugin name
by action because the new structure had not been checked for.

Also, there was a unit test which hasn't been adjusted to the
new structure as well because it was simply overlooked.

With this patch the bug is fixed and the fix is also covered
again by a unit test.

Releases: master
Resolves: #91249
Change-Id: I9acdaeb66010563d82c818ddf0a73e2adab780db
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64388
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Tested-by: Daniel Goerz <>
Reviewed-by: Helmut Hummel <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Alexander Schnitzler 24 days ago

  • Category set to Extbase
  • Status changed from New to Accepted
  • Assignee set to Alexander Schnitzler
  • Target version set to Candidate for patchlevel

Will have a look at it.

#2 Updated by Alexander Schnitzler 23 days ago

  • Status changed from Accepted to In Progress
  • Is Regression set to Yes

This is a regression due to the usage of controller classes instead of just base names for plugin name resolving in \TYPO3\CMS\Extbase\Service\ExtensionService::getPluginNameByAction.

#3 Updated by Gerrit Code Review 23 days ago

  • Status changed from In Progress 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/+/64388

#4 Updated by Anonymous 17 days ago

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

#5 Updated by Benni Mack 13 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF