Bug #76314
closedFluid: StandaloneView: RootNode could not be converted to string
0%
Description
Hello Core-Team,
Currently I get following error when using the StandaloneView of Fluid:
PHP Catchable Fatal Error: Object of class TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\RootNode could not be converted to string in /Applications/MAMP/htdocs/typo3_src/vendor/typo3fluid/fluid/src/Core/Compiler/TemplateCompiler.php line 175
<f:layout name="{layoutPath}" /> <f:section name="main"> ... </f:section>
if ( GeneralUtility::compat_version('7.6') || GeneralUtility::compat_version('8.0') ) { $this->view->assign('layoutPath', 'Typo3_76'); } else { $this->view->assign('layoutPath', 'Typo3_62'); }
The correct layoutPath will be assigned in TYPO3 6.2, 7.6 and 8.2-dev.
The problem is following part in TemplateCompiler.php
$templateCode = sprintf( $templateCode, $classDefinition, '$renderingContext->getVariableProvider()->get(\'layoutName\')', $parsingState->getVariableContainer()->get('layoutName'), ($parsingState->hasLayout() ? 'TRUE' : 'FALSE'), var_export($this->renderingContext->getViewHelperResolver()->getNamespaces(), TRUE), $generatedRenderFunctions ); $this->renderingContext->getCache()->set($identifier, $templateCode);
This line:
$parsingState->getVariableContainer()->get('layoutName'),
will return an object of type RootNode which can't be converted to string...which is needed by var_export.
Stefan
Updated by Claus Due over 8 years ago
Fixed in standalone Fluid in https://github.com/TYPO3Fluid/Fluid/pull/107
Updated by Daniel Goerz over 8 years ago
- Sprint Focus set to Stabilization Sprint
Updated by Oliver Hader over 8 years ago
- Status changed from New to Needs Feedback
So, if this is fixed already in the Fluid repository, we can close this issue, correct?
Updated by Stefan Froemken about 8 years ago
- Status changed from Needs Feedback to Closed
Works with a newer version of typo3fluid. Thank you for your work