Closed helsner closed 12 months ago
Very true, this looks like a leftover from a time when the render children closure did not take the "content argument" into account. I would appreciate a pull request that changes the ternary condition to simply calling $renderChildrenClosure()
to get the input argument for the array resolving function!
I got the issue that the sortviewhelper returns null when using the "subject" argument instead of the children.
$subject = static::arrayFromArrayOrTraversableOrCSVStatic(!empty($arguments['as']) ? $arguments['subject'] : $renderChildrenClosure());
in https://github.com/FluidTYPO3/vhs/blob/development/Classes/ViewHelpers/Iterator/SortViewHelper.php#L112 returns the children closure even if subject is set due to the necesseary "as". But adding "as" then fails later on while processing the name of the variable when callingreturn static::renderChildrenWithVariableOrReturnInputStatic(...
at the end of the functionThe current workaround is to only use the children closure handling.