Bug #96579
openFLUIDTEMPLATE always uses default action to find the template
0%
Description
FLUIDTEMPLATE always uses default Extbase action to find the template even if you specify extbase.controllerActionName
. Example:
10 = FLUIDTEMPLATE 10 { extbase { controllerActionName = logout controllerExtensionName = Felogin controllerName = Login pluginName = Login } settings < plugin.tx_felogin_login.settings templateRootPaths { 10 = EXT:template/Resources/Private/Plugins/FeLogin/BoxTemplates/ }
It will still render the login
action.
Problem seems to be in FluidTemplateContentObject::renderFluidView()
, which does not pass action name to the view as it should:
protected function renderFluidView() { return $this->view->render(); }
In the view:
public function render($actionName = null) { $renderingContext = $this->getCurrentRenderingContext(); $templateParser = $renderingContext->getTemplateParser(); $templatePaths = $renderingContext->getTemplatePaths(); if ($actionName) { $actionName = ucfirst($actionName); $renderingContext->setControllerAction($actionName); }
Here there will be no action, so rendering context will always contain default action for controller.
Also it is not worth trying templateName
because it will not be used if there is Extbase controller & plugin specified. So there is no way to use any action except the default one.
The fix: pass action to the view.
Updated by Torben Hansen over 2 years ago
I tested this in v12 main branch and can not even get the feature up and running with the provided code snippet. To me it seems this feature is broken (maybe since #93853 - just guessing).
The templateRootPaths
data will currently only be assigned to the view, when also a templateName
is set (see: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php#L139).
However, when a templateName
is set and $this->view->getRenderingContext()->setControllerAction($requestControllerActionName);
is added after the setRequest()
call in setExtbaseVariables
, this seem to work.
Updated by Riccardo De Contardi about 2 years ago
Is this related #81099 or a different one?
Updated by Garvin Hicking 5 months ago
- Related to Bug #82033: extbase parameters in FLUIDTEMPLATE : configuration lost for extension Form added