{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/22008","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/22008/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/22008/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/22008/events","html_url":"https://github.com/symfony/symfony/issues/22008","id":214428393,"number":22008,"title":"[Form] delete_empty don't work for embedded forms without data_class","user":{"login":"murilolobato","id":1851400,"avatar_url":"https://avatars2.githubusercontent.com/u/1851400?v=3","gravatar_id":"","url":"https://api.github.com/users/murilolobato","html_url":"https://github.com/murilolobato","followers_url":"https://api.github.com/users/murilolobato/followers","following_url":"https://api.github.com/users/murilolobato/following{/other_user}","gists_url":"https://api.github.com/users/murilolobato/gists{/gist_id}","starred_url":"https://api.github.com/users/murilolobato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murilolobato/subscriptions","organizations_url":"https://api.github.com/users/murilolobato/orgs","repos_url":"https://api.github.com/users/murilolobato/repos","events_url":"https://api.github.com/users/murilolobato/events{/privacy}","received_events_url":"https://api.github.com/users/murilolobato/received_events","type":"User","site_admin":false},"labels":[{"id":100079,"url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":99594,"url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD","default":false},{"id":237003792,"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed","default":false},{"id":2932845,"url":"https://api.github.com/repos/symfony/symfony/labels/Unconfirmed","name":"Unconfirmed","color":"444444","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-15T15:31:03Z","updated_at":"2017-03-15T18:27:44Z","closed_at":null,"body":"| Q                | A\r\n| ---------------- | -----\r\n| Bug report?      | yes\r\n| Feature request? | no\r\n| BC Break report? | no\r\n| RFC?             | no\r\n| Symfony version  | 2.8.18\r\n\r\nI'm creating a form, that has a collection of another form. OrderType has a collection of ItemType. Assuming that both have the option `data_class = null`, empty items are not being removed during form submit. Empty Items are being validated. The expected behavior was that empty items would be removed, as it happens when I create entities for this two types and set them in type's `data_class` options.\r\n\r\nLooking at the source code and other issues, people already have had problem with delete_empty, but this is a new case. I've also found the tests to `delete_empty` and the scenario I've listed above is not being tested.\r\n\r\nHere is the test with data_class defined: https://github.com/symfony/Form/blob/master/Tests/Extension/Core/Type/CollectionTypeTest.php#L145\r\n\r\nI'll try to create a test, and attach to this issue, but I can't promise anything."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/286836414","html_url":"https://github.com/symfony/symfony/issues/22008#issuecomment-286836414","issue_url":"https://api.github.com/repos/symfony/symfony/issues/22008","id":286836414,"user":{"login":"yceruto","id":2028198,"avatar_url":"https://avatars3.githubusercontent.com/u/2028198?v=3","gravatar_id":"","url":"https://api.github.com/users/yceruto","html_url":"https://github.com/yceruto","followers_url":"https://api.github.com/users/yceruto/followers","following_url":"https://api.github.com/users/yceruto/following{/other_user}","gists_url":"https://api.github.com/users/yceruto/gists{/gist_id}","starred_url":"https://api.github.com/users/yceruto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yceruto/subscriptions","organizations_url":"https://api.github.com/users/yceruto/orgs","repos_url":"https://api.github.com/users/yceruto/repos","events_url":"https://api.github.com/users/yceruto/events{/privacy}","received_events_url":"https://api.github.com/users/yceruto/received_events","type":"User","site_admin":false},"created_at":"2017-03-15T18:27:44Z","updated_at":"2017-03-15T18:27:44Z","body":"@murilolobato if `allow_delete` is `false` then `delete_empty` does not work ( see test https://github.com/murilolobato/symfony/blob/ede90e8957195a15223fd5d689b4198801852a56/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php#L142)\r\n\r\nCound you try with `'allow_delete' => true` also?"}}
{"actor":{"display_login":"yceruto"}}