neos-ui icon indicating copy to clipboard operation
neos-ui copied to clipboard

BUG: NodeCreationDialog should not submit empty string for optional fields

Open mhsdesign opened this issue 1 year ago • 0 comments

I was curious about the $propertyValue === '' && !TypeHandling::isSimpleType($propertyType) part in Neos 8.3 because it seems to have gone missing in 9.0 after the ESCR adjustments.

Originally it was introduced to fix https://github.com/bwaidelich/Wwwision.Neos.CreationDialogProperties/issues/10

But when using the nodePropertyConversionService we get the $rawValue !== '' check for free in:

https://github.com/neos/neos-ui/blob/01ac51c52e66a2ad6fb9d9dcbff9623739e5da14/Classes/Domain/Service/NodePropertyConversionService.php#L87

So Neos 8.3 would even forgive us not filtering out this case and writing an empty string to the node because we handle it currently at the read site:

https://github.com/neos/neos-development-collection/blob/eada1dbfb569de6e3932b26b4b3c630401020e05/Neos.ContentRepository/Classes/Domain/Model/Node.php#L924-L931

Neos 9 on the other hand is much stricter and we must check if the original issue https://github.com/bwaidelich/Wwwision.Neos.CreationDialogProperties/issues/10 will resurface.

Originally posted by @mhsdesign in https://github.com/neos/neos-ui/pull/3720#discussion_r1493305103

mhsdesign avatar Mar 16 '24 13:03 mhsdesign