{"action":"created","issue":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/5027","repository_url":"https://api.github.com/repos/Sylius/Sylius","labels_url":"https://api.github.com/repos/Sylius/Sylius/issues/5027/labels{/name}","comments_url":"https://api.github.com/repos/Sylius/Sylius/issues/5027/comments","events_url":"https://api.github.com/repos/Sylius/Sylius/issues/5027/events","html_url":"https://github.com/Sylius/Sylius/issues/5027","id":154714964,"number":5027,"title":"[Resource][Form] Why did ObjectToIdentifierTransformer get reversed?","user":{"login":"peteward","id":7068515,"avatar_url":"https://avatars.githubusercontent.com/u/7068515?v=3","gravatar_id":"","url":"https://api.github.com/users/peteward","html_url":"https://github.com/peteward","followers_url":"https://api.github.com/users/peteward/followers","following_url":"https://api.github.com/users/peteward/following{/other_user}","gists_url":"https://api.github.com/users/peteward/gists{/gist_id}","starred_url":"https://api.github.com/users/peteward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteward/subscriptions","organizations_url":"https://api.github.com/users/peteward/orgs","repos_url":"https://api.github.com/users/peteward/repos","events_url":"https://api.github.com/users/peteward/events{/privacy}","received_events_url":"https://api.github.com/users/peteward/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Sylius/Sylius/labels/RFC","name":"RFC","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-13T13:44:09Z","updated_at":"2016-05-19T07:27:25Z","closed_at":null,"body":"The `DataTransformerInterface` [on github](https://github.com/symfony/form/blob/master/DataTransformerInterface.php) specifies:\r\n\r\n* `transform()`  Transforms a value from the original representation to a transformed representation.\r\n* `reverseTransform()` Transforms a value from the transformed representation to its original representation.\r\n\r\nThis seems logical and sensible to me, but `ObjectToIdentifierTransformer` seems to have been reversed so the opposite happens - and it blows up our forms as a result.\r\n\r\nIt happened in [this PR](https://github.com/Sylius/Sylius/pull/4702), it seems very wrong to me.\r\n\r\nI can only think that the other changes in this PR which add an extra condition for `multiple` means that it wasn't actually ever called after the change so no one noticed it was broken.\r\n\r\nUnless I'm wrong somehow?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Sylius/Sylius/issues/comments/220247848","html_url":"https://github.com/Sylius/Sylius/issues/5027#issuecomment-220247848","issue_url":"https://api.github.com/repos/Sylius/Sylius/issues/5027","id":220247848,"user":{"login":"Zales0123","id":6212718,"avatar_url":"https://avatars.githubusercontent.com/u/6212718?v=3","gravatar_id":"","url":"https://api.github.com/users/Zales0123","html_url":"https://github.com/Zales0123","followers_url":"https://api.github.com/users/Zales0123/followers","following_url":"https://api.github.com/users/Zales0123/following{/other_user}","gists_url":"https://api.github.com/users/Zales0123/gists{/gist_id}","starred_url":"https://api.github.com/users/Zales0123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zales0123/subscriptions","organizations_url":"https://api.github.com/users/Zales0123/orgs","repos_url":"https://api.github.com/users/Zales0123/repos","events_url":"https://api.github.com/users/Zales0123/events{/privacy}","received_events_url":"https://api.github.com/users/Zales0123/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T07:27:25Z","updated_at":"2016-05-19T07:27:25Z","body":"I think the reason of this whole mess with ``ObjectToIdentifierTransformer`` is the fact it's used in two different situations. In some of them we need to get identifier from object, in other *vice versa*. I don't remember what are this edge cases (hopefully will remember soon 😄 ) but I'm pretty sure I've struggling with both of them while working with ``ObjectToIdentifierTransformer``."}}