Project

General

Profile

Actions

Bug #86930

closed

ifAuthenticated ViewHelper produces no output on first run after template modification / cache clear

Added by Björn Steinbrink over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2018-11-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using an ifAuthenticated ViewHelper, the contents of the view helper are missing the first time the template is rendered. If you reload the page while logged in in the backend (maybe only when logged in with admin privileges), the view helper works from the second time. onward. But if the reload happens as an ordinary frontend user, the content will stay missing.

The base class TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper of this view helper says to implement render() in derived classes, and, for example, the IfViewHelper does this. Adding a straightforward implementation of render() seems to fix the problem, with render() only being called on the first rendering, so it seems like render() is used just once when the View Helper has not been compiled yet? I'm not really familiar with how view helper compilation works, so this is just guess work.

Actions

Also available in: Atom PDF