Skip to content

[Form] Update existing Object Collection #3293

Closed
@ghost

Description

If I create a form with an embedded form as collection and define allow_add, I can create the object with sub-objects without a problem.
When I try to update the object with more sub-objects, it doesn't save the new objects.
I think the problem is inside bindRequest (before I do the bindRequest, there are 2 objects inside and after 0 objects).
The form shows the right amount of objects in the view.

This case worked before.
I found out that inside src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php $originalData and $data are the same on update with new objects. Because they are the same, they are deleted at Line 167.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions