Closed
Description
Hello, i'm having an issue with ComponentWithFormTrait + LiveCollectionTrait.
I don't know what i could have done wrong but when removing all the element from a collection, when the last element is removed, the code fail because the field contains an empty PersistentCollection instead of the usual array. Before the collection is empty it's an array, it becomes a PeristentCollection when it's empty.
So the LiveFormUtility::removePathsNotInData used during ComponentWithFormTrait::submitForm fails when trying to call array_key_exists.
Any idea what could explain for the collection field to get filled with an empty PersistentCollection ?
Maybe the entity side can be of help to understand the problem :