Project

General

Profile

Actions

Bug #76314

closed

Fluid: StandaloneView: RootNode could not be converted to string

Added by Stefan Froemken over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
Start date:
2016-05-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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

Actions

Also available in: Atom PDF