-
Notifications
You must be signed in to change notification settings - Fork 11
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
DISCUSSION: Should property: null
be ignored?
#41
Comments
|
Currently the discussion is to "not try to be smarter than the system" (the system being the neos cr) We are thinking about introducing a |
Neos 9 has a bug which initially omits the As talked with @kitsunet we are unsure what the correct behaviour should be :D |
When building a more complex template and a loop, you might encounter the situation, when you only want to set this property on iteration 1 or something and otherwise return
null
, thinking it will be ignored.Currently the behaviour with null might not be 100% obvious.
in the first case
someSimplePropertyWithDefaultValue
will be set to null (see$node->getProperties()
) (also see somewhat related discussion about properties without default value or not previous value beeing skipped: neos/neos-development-collection#4292)in the latter cases with the reference properties, the null value will be (rightfully) ignored, but because the
setProperty
will guard this:https://github.com/neos/neos-development-collection/blob/1b744c8a6959a4aae735ffc6dd360f33847c98aa/Neos.ContentRepository/Classes/Domain/Model/AbstractNodeData.php#L167-L188C1
the question i asked myself, if it would be generally expected, that when null is returned, that the
setProperty
operation will be skipped for the property.This would be helpful for cases, where you dont want to hardcode the default value. But this change might be breaking in unexpected ways...
The text was updated successfully, but these errors were encountered: