Open BlitzInternet opened 6 years ago
Indeed the manual is outdated there. The correct implementation for a condition ViewHelper (since the shift to Standalone Fluid with 4.0) is explained in the docblock of the abstract class only. Needs to be fixed, so thanks for the hint. Keeping docs in sync is sometimes not so easy.
Not sure why things changed again with 4.3.3, I can only guess that something inside Typo3fluid changed.
Description
For once I'm not sure if this is a bug or if the manual is not up-to-date. http://flowframework.readthedocs.io/en/4.3/TheDefinitiveGuide/PartIII/Templating.html#abstractconditionviewhelper
There is no mention of the need to implement renderStatic. When I migrated the first project to flow 4.3 I started seeing problems with all my custom conditional viewhelpers, ie. any that extended \Neos\FluidAdaptor\Core\ViewHelper\AbstractConditionViewHelper
They were rendering on the first call, and then never again. Digging into the code it turns out that not overriding the renderStatic method caused this. There is no mention of this in the manual!
I worked around it by creating my own AbstractConditionViewHelper (extending the same class the original one did) and removing all static methods. Things worked for the last month, but now in v4.3.3, new problems popped up and I can't tell why all of a sudden.
Apparently extending TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper in ANY WAY causes this to render empty, since this class now has an empty renderStatic method.
It should go without saying that I cannot use static methods in most viewhelpers so this is not an option.
Please document a way to create your own ViewHelpers that do not require any static methods!
Steps to Reproduce
Expected behavior
view helper then or else is still rendered upon second rendering
Actual behavior
else is always rendered starting from second rendering because lack of implemented renderStatic methods
Affected Versions
neos/flow 4.3.3 neos/fluid-adaptor 4.3.3 typo3fluid/fluid 2.1.3