You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a collection of another form type, and you want that empty items are deleted, you have to dig around the web (old issues and wrong workarounds), to discover that you just have to set entry_options => array('required' => false) at the collection definition.
I think, we could update the collection doc, in the section of delete_empty, to warn the developers about this behavior. And, why this entry_options => array('required' => false) makes sense? In my opinion, i think it is not legible. I'm available to help!
Instructions about delete_empty are partially ok. It instructs only that allow_delete must be enabled.
If you have a collection of another form type, and you want that empty items are deleted, you have to dig around the web (old issues and wrong workarounds), to discover that you just have to set
entry_options => array('required' => false)
at the collection definition.I've discovered this searching in the issues. And found symfony/symfony#13940 which points to https://github.com/symfony/Form/blob/master/Tests/Extension/Core/Type/CollectionTypeTest.php#L145-166
I think, we could update the collection doc, in the section of delete_empty, to warn the developers about this behavior. And, why this
entry_options => array('required' => false)
makes sense? In my opinion, i think it is not legible. I'm available to help!UPDATE
I have just found, why
required => false
makes sense. http://symfony.com/doc/2.8/reference/forms/types/form.html#empty-dataThe text was updated successfully, but these errors were encountered: