Bug #91249
closedTwo plugins calling the same action method
100%
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.
Updated by Alexander Schnitzler over 4 years 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.
Updated by Alexander Schnitzler over 4 years 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
.
Updated by Gerrit Code Review over 4 years 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
Updated by Anonymous over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2f366190bec643d6532c131199d350162da3abcc.
Updated by Paul Kamma over 4 years ago
Anonymous wrote:
Applied in changeset 2f366190bec643d6532c131199d350162da3abcc.
This problem also exists in 9.5. Do I have to create a seperate issue?
Updated by Hagen Gebauer over 4 years ago
Paul Kamma wrote:
Anonymous wrote:
Applied in changeset 2f366190bec643d6532c131199d350162da3abcc.
This problem also exists in 9.5. Do I have to create a seperate issue?
Hi! Are you on the latest version of 9.5? I run the same extension on a T3v9.5.19 instance and do not have the problem there. I even just tested several versions between and including 9.5.13 and 9.5.19 in order to find the reason for another issue that had just appeared recently – and I did not get the error message described in this issue.
Updated by Paul Kamma over 4 years ago
Hagen Gebauer wrote:
Paul Kamma wrote:
Anonymous wrote:
Applied in changeset 2f366190bec643d6532c131199d350162da3abcc.
This problem also exists in 9.5. Do I have to create a seperate issue?
Hi! Are you on the latest version of 9.5? I run the same extension on a T3v9.5.19 instance and do not have the problem there. I even just tested several versions between and including 9.5.13 and 9.5.19 in order to find the reason for another issue that had just appeared recently – and I did not get the error message described in this issue.
Yes, but I have the issue on an another extension cart_products, I thought it was a global issue.
Is it something the extension developer have to fix?
Updated by Jennifer Hauß about 4 years ago
I'm experiencing the same issue on 9.5.22 in a custom extension. I have two plugins configured which can call the same action. Issue appears when trying to redirect to one of those actions.
Uri-Builder line 459-554 does:
if ($pluginName === null && $this->environmentService->isEnvironmentInFrontendMode()) {
$pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controllerArguments['controller'], $controllerArguments['action']);
}
if ($pluginName === null) {
$pluginName = $this->request->getPluginName();
}
error happens inside the first if-statement. Why don't switch those two if-statements and use the current plugin as default?