Skip to content

BUGFIX: Throw helpful exception when collection property has missing element type#2139

Merged
albe merged 6 commits intoneos:5.3from
albe:missing-elementtype-exception
Sep 25, 2020
Merged

BUGFIX: Throw helpful exception when collection property has missing element type#2139
albe merged 6 commits intoneos:5.3from
albe:missing-elementtype-exception

Conversation

@albe
Copy link
Copy Markdown
Contributor

@albe albe commented Sep 19, 2020

Fixes #978

Comment thread Neos.Flow/Classes/Property/TypeConverter/CollectionConverter.php Outdated
@albe albe requested a review from bwaidelich September 24, 2020 07:59
Comment thread Neos.Flow/Tests/Unit/Property/TypeConverter/CollectionConverterTest.php Outdated
Copy link
Copy Markdown
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying

+1 by reading

@albe albe merged commit fad8657 into neos:5.3 Sep 25, 2020
@albe albe deleted the missing-elementtype-exception branch September 25, 2020 15:37
@albe
Copy link
Copy Markdown
Contributor Author

albe commented Nov 9, 2020

Apparently, the exception will not be thrown when an empty collection is submitted. Which is a bit... shaggy.
See #2218

Adding a check to the ObjectConverter is probably more sane, but also not as easy (we have three versions of where to check the type - constructor arguments, setter argument, property). Or one could make the point, that it is only really a problem when actually submitting values, because then property mapping will fail, so this is fine as is 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants