symfony/symfony — Issue #3293: [Form][Collection] Update existing Object Collection
Author: ibrows
Created: 2012-02-07 10:31:42+00:00
State: open

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.