Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty template rendering as NULL #1679

Open
j6s opened this issue Jul 22, 2019 · 1 comment
Open

Empty template rendering as NULL #1679

j6s opened this issue Jul 22, 2019 · 1 comment

Comments

@j6s
Copy link

j6s commented Jul 22, 2019

Description

This is only a minor thing that I noticed - it may even be happening on purpose:
When rendering an empty template NULL is being returned instead of an empty string (which I would have expected).

I noticed this when starting to mock up empty files as templates while using strict_types=1.

[Description of the bug or feature]

Test to outline issue

$view = new StandaloneView();
$view->setTemplateSource('');

$this->assertNotNull($view->render());
// => Failed asserting that null is not null.

Affected Versions

I have not tried to find out how far back this issue goes - all I can say is that it affects the most current versions (Neos 4.3).

Neos: 4.3.x-dev 3b49cca
Flow: 5.3.2

@albe
Copy link
Member

albe commented Jul 22, 2019

That's indeed an issue with TYPO3 Fluid then, because we don't override the render function anywhere and setTemplateSource() just forwards to the internals of Fluid. On a quick glance I couldn't find anything obvious in the Fluid source, in the case above the result should be a single TextNode with an empty string content and hence the render method should evaluate to that empty string instead of null, but obviously there's something else going on. A quick unit test could help verify the illbehaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants