Skip to content

[form] Delete_empty issue #13601

Closed
Closed
@Looted

Description

@Looted

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions