Bug #88399
openController action ignored when defined through Typoscript
0%
Description
Having correctly configured extension in ext_localconf.php, controllers, actions and associated settings assigned via TypoScript are completely ignored during run.
Example;
In ext_localconf.php;
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( VendorName.ExtensionName, PluginName, [ 'Frontend' => 'index', 'Account' => 'index,login,logout,register' ], [ 'Account' => 'login,logout,register' ]);
Example ts setup;
page = PAGE page { ... 10 = USER 10 { ... userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run vendorName = VendorName extensionName = ExtensionName pluginName = PluginName controller = Frontend action = index } } ... 5 = USER_INT 5 { userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run vendorName = VendorName extensionName = ExtensionName pluginName = PluginName controller = Account action = login }
In this setup, userFunc is picked up together with vendorName, extensionName, and pluginName. The rest of the details are ignored.
I then went 'under the hood' to check what's going on and found that TYPO3 9 processes controller and action configurations only if they come from GET/POST (ServerRequest) parameters. (See TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::build()) If no parameter is found, RequestBuilder simply picks up the first controller and first action available under configured plugin. (See TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::loadDefaultValues()).
Am I wrong, or is there something am missing or is this by design and how can one go about defining controller action via TypoScript?
Thanx.
Updated by John Miller over 5 years ago
- Tracker changed from Epic to Feature
- Description updated (diff)
Updated by John Miller almost 5 years ago
- Tracker changed from Feature to Bug
- Subject changed from Controller/Action ignored when defined through Typoscript to Controller action ignored when defined through Typoscript
- Category changed from TypoScript to Extbase
- Start date changed from 2019-05-20 to 2020-01-08
- TYPO3 Version set to 10
- PHP Version set to 7.2
- Tags set to extbase TypoScript controller action
Updated by Alexander Schnitzler almost 5 years ago
- Status changed from New to Accepted
I shortly checked it and your findings are right. The given action is only used if present as query argument.
The behaviour is the same in TYPO3 9.5, so I figure it has been like this for a while.
From my experience I would say that this is a bug but not a regression.
Updated by S P almost 3 years ago
The configuration key action
does not exist. Where did you get this from? You have to configure your actions through the switchableControllerActions
. The first one will be loaded initially, all other can be requested through GET/POST parameters at runtime. The actions must be a subset of the complete action list from the ext_localconf.php
file.
switchableControllerActions { YourController { 1 = yourDefaultAction 2 = thisActionCanBeCalled 3 = anotherAllowedAction } }
NOTE: switchableControllerActions are deprecated in v10 (but still work in v11)! You have to use separate plugins starting with v12 anyways.
I think the issue can be closed as I can't see a bug here. Maybe unclear documentation.