Actions
Bug #96579
openFLUIDTEMPLATE always uses default action to find the template
Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2022-01-19
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
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.
Actions