{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/4492","labels_url":"https://api.github.com/repos/symfony/symfony/issues/4492/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/4492/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/4492/events","html_url":"https://github.com/symfony/symfony/issues/4492","id":4885817,"number":4492,"title":"[Form] Handling entities reordering in collection type","user":{"login":"maciej-pyszynski","id":1814715,"avatar_url":"https://avatars.githubusercontent.com/u/1814715?v=3","gravatar_id":"","url":"https://api.github.com/users/maciej-pyszynski","html_url":"https://github.com/maciej-pyszynski","followers_url":"https://api.github.com/users/maciej-pyszynski/followers","following_url":"https://api.github.com/users/maciej-pyszynski/following{/other_user}","gists_url":"https://api.github.com/users/maciej-pyszynski/gists{/gist_id}","starred_url":"https://api.github.com/users/maciej-pyszynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciej-pyszynski/subscriptions","organizations_url":"https://api.github.com/users/maciej-pyszynski/orgs","repos_url":"https://api.github.com/users/maciej-pyszynski/repos","events_url":"https://api.github.com/users/maciej-pyszynski/events{/privacy}","received_events_url":"https://api.github.com/users/maciej-pyszynski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2012-06-04T10:45:03Z","updated_at":"2015-04-28T13:39:48Z","closed_at":null,"body":"Symfony default behaviour for handling reordering in collection type is wrong.\n\nWhen you reorder to items saved in database as:\n\nid: 56, name: first, order: 0\nid: 57, name: second, order: 1\n\nAfter changing they positions I receive:\n\nid: 56, name: second, order: 0\nid: 57, name: first, order: 1\n\nInstead of:\n\nid: 56, name: first, order: 1\nid: 57, name: second, order: 0\n\nLast occurrence at version 2.0.15"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/97067713","html_url":"https://github.com/symfony/symfony/issues/4492#issuecomment-97067713","issue_url":"https://api.github.com/repos/symfony/symfony/issues/4492","id":97067713,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T13:39:48Z","updated_at":"2015-04-28T13:39:48Z","body":"@webdevilopers a choice form does not preserve ordering.\r\nSubmitting an HTML form has no way to submit the order of selected elements. It does not even has this concept in the spec. Browsers generally add values in the order in which they appear in the DOM, but there is no requirement to do that. So if you need to save the order, you should indeed use a separate field for that."}}