Open mhsdesign opened 1 week ago
nvm deleted my previous comment I thought unsetsValueWithDefault is a feature here^^ Still seems right behavior?
Hmmm i dont think its right if a followup SetNodeProperties
can unset that property like i did here: (because i had to precise tests 😂 and couldnt let it slip)
Wait what? I don't think you should be able to unset default values, you can overwrite them with other values but not remove them?
😂 hahah yes sounds legit ... i just wondered a year ago what the behaviour might be and observed that its possible and put it in stone via the node template tests :D I guess there might be people relying on this ... eg setting an text field back to empty (which is null effectively by the neos ui)
While the change https://github.com/neos/neos-development-collection/pull/4322 improved the unset handling of properties a lot, it introduced a regression.
Using the following NodeType
and creating it but using
would originally set
unsetValueWithDefault
toNULL
in the database. This was the behaviour in Neos 8.3 and Neos 9 before the mentioned change. Now when fetching the nodes properties we get the following result - the default value is still present:The reason for that is that we filter out the unsets when creating a node (under the impression that no one would do this ^^):
https://github.com/neos/neos-development-collection/blob/7db53b6c4ec590973e063077a8c4a2ab72801c5c/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php#L88
A workaround for now is to followup with a
SetNodeProperties
command