Open gradinarufelix opened 4 years ago
I'm still a bit stumbled on how that would have worked correctly before under same circumstances:
This lead to a null
Resource in at least Flow 5.x too as of https://github.com/neos/flow-development-collection/blob/5.0/Neos.Flow/Classes/ResourceManagement/ResourceTypeConverter.php#L186
Then when the AssetConverter is triggered, it would receive the null
Resource as child property and pass that to the Image
constructor, which should have failed beforehand, too, since the required non-null Resource
argument is there for longer. So in conclusion, something would have to be changed in the conversion process for a generic PersistentObject
(which the AssetConverter
extends) in Flow. But oddly, things haven't changed in the PropertyMapper of Flow for quite some time. The most notable/relevant change was support for converting to nullable target types as null
and was done over a year ago (4.3.10+).
So let's first try to really reproduce the behaviour in isolation within the media package tests if possible.
Anyway, the supposed fix above still makes sense.
Description
When passing an empty value for the resource property of an Asset (neos/media), the following exception is thrown instead of returning no Asset.
The use case is a file upload field in a FluidTemplate that is optional, so not necessarily an image must be uploaded.
Steps to Reproduce
<f:form.upload>
field.Expected behavior
That the property mapper evaluates the whole Asset to null.
Actual behavior
Exception is thrown.
Affected Versions
Neos: 5.0.3
Flow: 6.0.3