Skip to content
Snippets Groups Projects
Commit af39d480 authored by Claus Due's avatar Claus Due Committed by Christian Kuhn
Browse files

[BUGFIX] Fix getTemplatePathAndFilename on StandaloneView

This patch avoids calling a non-existing method and instead calls
upon TemplatePaths to resolve the template file - which is closer
to the original behavior.

Change-Id: Ib2669056e59bf1a6524e35e02e1f677226a5efa5
Resolves: #79073
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/51021


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMarkus Sommer <markussom@posteo.de>
Tested-by: default avatarMarkus Sommer <markussom@posteo.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 4075b40e
Branches
Tags
No related merge requests found
......@@ -138,19 +138,23 @@ class StandaloneView extends AbstractTemplateView
}
/**
* Returns the absolute path to a Fluid template file if it was specified with setTemplatePathAndFilename() before
* Returns the absolute path to a Fluid template file if it was specified with setTemplatePathAndFilename() before.
* If the template filename was never specified, Fluid attempts to resolve the file based on controller and action.
*
* NB: If TemplatePaths was previously told to use the specific template path and filename it will short-circuit
* and return that template path and filename directly, instead of attempting to resolve it.
*
* @return string Fluid template path
* @throws \RuntimeException
* @api
*/
public function getTemplatePathAndFilename()
{
$templatePaths = $this->baseRenderingContext->getTemplatePaths();
if ($templatePaths instanceof TemplatePaths) {
return $templatePaths->getTemplatePathAndFilename();
}
throw new \RuntimeException('The template paths storage must be of type ' . TemplatePaths::class, 1482251889);
return $templatePaths->resolveTemplateFileForControllerAndActionAndFormat(
$this->baseRenderingContext->getControllerName(),
$this->baseRenderingContext->getControllerAction(),
$templatePaths->getFormat()
);
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment