Bug #78155
closedCould not load layout file. Tried following paths
0%
Description
i get very unusual error :
#1288092555: Could not load layout file. Tried following paths: "/home/simcotest/domains/simcotest.test.uwkm.nl/public_html/typo3conf/ext/uwkm_rma/Resources/Private/Templates/Products/Layouts/Default.html", "/home/simcotest/domains/simcotest.test.uwkm.nl/public_html/typo3conf/ext/uwkm_rma/Resources/Private/Templates/Products/Layouts/Default"
as you can see from error it searches inside Templates/ControllerName which is a very wrong path.
in typoscript setup i have following :
plugin.tx_uwkmrma_rmaform { view { templateRootPath = EXT:uwkm_rma/Resources/Private/Templates/ partialRootPath = EXT:uwkm_rma/Resources/Private/Partials/ layoutRootPath = EXT:uwkm_rma/Resources/Private/Layouts/ } persistence { storagePid = {$plugin.tx_uwkmrma_rmaform.persistence.storagePid} } }
the extension works well until i try to load custom template file within php
public function getTemplateHtml($controllerName, $templateName, array $variables = array()) { $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $extbaseFrameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']); $templatePathAndFilename = $templateRootPath.$controllerName.'/'.$templateName.'.html'; $emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $emailView->setTemplatePathAndFilename($templatePathAndFilename); $emailView->assign('args', $variables); $tempHtml = $emailView->render(); return $tempHtml; }
so if i call function $this->getTemplateHtml('Products', 'Email', $args);
the following template is being loaded:
/home/simcotest/domains/simcotest.test.uwkm.nl/public_html/typo3conf/ext/uwkm_rma/Resources/Private/Templates/Products/Email.html
but we get error about missing Layout file. not sure why it's looking in the wrong directory. if i make layout file there the error doesn't appear, however the translations are missing so the line <f:translate key='tx_uwkmrma_domain_model_rma.invoiceAdres' /> is an empty string.
not sure why i have this bug, have used same code in another extension in typo3 v6.x had no such errors.