neos-development-collection
neos-development-collection copied to clipboard
Regression 8.0 Fusion `DataStructure` omits `null` value in rare case
In Neos 7.3 this rendered to
root = Neos.Fusion:Component {
somePathWithPlainNull = null
renderer = Neos.Fusion:DataStructure {
key = ${props.somePathWithPlainNull}
}
}
{"key": null}
but similar to https://github.com/neos/neos-development-collection/issues/3859 probably since 8.0 change https://github.com/neos/neos-development-collection/pull/3645 in the result the key "key" is completely omitted:
{}
Similar to https://github.com/neos/neos-development-collection/pull/3677 this is a problem with the global use of the "$lastEvaluationStatus" flag.
I traced the problem down to:
Before the eel expression is evaluated evaluateExpressionOrValueInternal the evaluation status is set to "EXECUTED", but inside the eel expression via "props.somePathWithPlainNull" we trigger a side effect because this lazy prop is evaluated and because fusion finds nothing useful in "somePathWithPlainNull" it sets the status to "SKIPPED".
Because of that we skip the value in the data-structure: https://github.com/neos/neos-development-collection/blob/132321889aeeca17caa2a6f3117e1fbc8e8a5a9e/Neos.Fusion/Classes/FusionObjects/AbstractArrayFusionObject.php#L133-L135
related problem: that fusion has no good concept of null. The assigned values = null and = ${null} are treated internally completely different.
I thought that was intentional to basically allow unsetting keys, eg. for css class merging?
has to be retested after https://github.com/neos/neos-development-collection/pull/5033