Closed
Description
I have a one-to-many relation, where child is the owning side. I embed the childs form in the parents form as a collection type field. That way I can dynamically add new children, change their content and remove them (with the oprhanRemoval set to true on parent entity annotations). When I leave the child form empty however, this happens:
An exception occurred while executing 'INSERT INTO child
(content, completed, parent_id, created_by) VALUES (?, ?, ?, ?)'
with params [null, null, null, null]: Column 'content' cannot be null
The request with the parent entity has:
children => [
0 => [
content =>
]
],
Delete_empty and allow_delete is of course set to true. There is no required set. Any idea why doctrine tries to perform an insert instead of deleting the empty entity?