#106444Action link viewhelper should not duplicate extension name
Description
I create an action link like this:
<f:link.action action="choseTips" pluginName="myextension_tips" pageUid="...">
Tipps hinzufügen
</f:link.action>
The URL gets generated like this:
?tx_myextension_myextension_tips[action]
So the extension part of the plugin gets repeated. Took me a while to see even staring at the link.
Then the action gets forwarded to the default action by error handling and it is hard to detect why we land in the wrong action.
Reviews 1
History 911
-
Lina Wolf changed category 03/27/25, 09:00
-
Torben Hansen commented and changed status
NewNeeds Feedback 03/29/25, 17:50 -
Lina Wolf commented 03/30/25, 13:54
The integrator needs to know the exact difference between CType and plugin name then. If they make an error there is no error message, wrong links get generated, the user is forwarded to the default action and there is confusion as to why the parameters are not working.
I just think this is an error that we could catch. -
Lina Wolf changed status
Needs FeedbackNew 03/31/25, 05:57 -
Georg Ringer commented and changed status
NewNeeds Feedback 04/16/25, 15:18what do you expect? should the link not be rendered, logged? exception?
-
Lina Wolf commented and changed status
Needs FeedbackNew 04/25/25, 14:38I would expect either and exception or that it works and creates links like `?tx_myextension_tips[action]`
We could for example only allow a-zA-Z0-9 for parameter pluginName and throw an exception when something else is entered. I dont know if it is feasible to look up in the Extbase registry if there is a plugin of that name or if that would take up to much time.Another possibility would be to test for the existence of an underscore and if there is exactly one to split by underscore and use the first part for extension and the last part for the plugin
-
Gerrit Code Review pushed patch set 1 for main to change 89242 status
NewUnder Review 04/26/25, 06:50 -
Lina Wolf commented 04/26/25, 06:51
@just2b I added a Change to demonstrate how I would imagagine this
-
Gerrit Code Review pushed patch set 2 for main to change 89242 04/26/25, 06:58
-
Torben Hansen commented and changed status
Under ReviewNeeds Feedback 05/31/25, 05:32Can this issue be closed? The suggested patch has been Abandoned.
-
Christian Kuhn changed status
Needs FeedbackClosed 03/03/26, 14:54
This is actually not a bug, since the parameter
pluginNamemust only include the plugin name and not a combination of extension name and plugin name. The plugin name is always the plugin name defined inExtensionUtility::configurePlugin.Additionally, the ViewHelper has a dedicated parameter named
extensionNameto define the extension name (if required or different than current extension name) and if this is ommited, the current extension name is added automatically.So basically, you do not use the ViewHelper as intended, because you provide a wrong/not existing pluginName and ommit the extensionName parameter.