Mapping objects with collection properties fails on empty request argument
|Priority:||Must have||Due date:|
|Assignee:||Karsten Dambekalns||% Done:||
|Target version:||TYPO3 Flow Base Distribution - 1.0 alpha 12||Estimated time:||1.00 hour|
|Has patch:||FLOW3 version affected:|
When an object contains a typed (non-literals only) collection property (array or Traversable) the PropertyMapper wants to fill that collection with the relevant objects. Now when a web form was used and there is nothing coming in (e.g. nothing selected in a select form element), this leads to
foreach being used on an empty string - which results in an error.
[+BUGFIX] FLOW3 (Property): Fix mapping of empty traversables from request
When a property is a collection of objects map() tries to use foreach on
the values. If the value is an empty string foreach causes an error.
Avoid this by checking the type first.