Bug #76314

Fluid: StandaloneView: RootNode could not be converted to string

Added by Stefan Froemken over 5 years ago. Updated about 5 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

#1

Updated by Claus Due over 5 years ago

#2

Updated by Daniel Goerz about 5 years ago

  • Sprint Focus set to Stabilization Sprint
#3

Updated by Benni Mack about 5 years ago

  • Target version changed from 8.2 to 8.3
#4

Updated by Oliver Hader about 5 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?

#5

Updated by Benni Mack about 5 years ago

  • Target version changed from 8.3 to 8.4
#6

Updated by Stefan Froemken about 5 years ago

  • Status changed from Needs Feedback to Closed

Works with a newer version of typo3fluid. Thank you for your work

Also available in: Atom PDF