{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/544","repository_url":"https://api.github.com/repos/doctrine/DoctrineModule","labels_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/544/comments","events_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/544/events","html_url":"https://github.com/doctrine/DoctrineModule/issues/544","id":120187829,"number":544,"title":"ObjectSelect + object as custom identifier is broken","user":{"login":"manuakasam","id":1087280,"avatar_url":"https://avatars.githubusercontent.com/u/1087280?v=3","gravatar_id":"","url":"https://api.github.com/users/manuakasam","html_url":"https://github.com/manuakasam","followers_url":"https://api.github.com/users/manuakasam/followers","following_url":"https://api.github.com/users/manuakasam/following{/other_user}","gists_url":"https://api.github.com/users/manuakasam/gists{/gist_id}","starred_url":"https://api.github.com/users/manuakasam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manuakasam/subscriptions","organizations_url":"https://api.github.com/users/manuakasam/orgs","repos_url":"https://api.github.com/users/manuakasam/repos","events_url":"https://api.github.com/users/manuakasam/events{/privacy}","received_events_url":"https://api.github.com/users/manuakasam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-03T14:50:40Z","updated_at":"2016-06-13T11:08:15Z","closed_at":"2015-12-04T09:26:33Z","body":"Hey :)\r\n\r\nWe just ran into an issue. We're using a custom mapping type as identifier using ramsey/uuid-doctrine by @ramsey \r\n\r\nThe problem arising with this is that the Proxy behind the form element is now receiving an object as identified by the custom mapping type. However Zend\\Form is not able to use Objects as values since internally the value is usually a `string` an `integer` or `boolean`.\r\n\r\nI'm thinking that this may be an issue solely for `ObjectSelect` as this one is taking care of all the magic yadda yadda. \r\n\r\nHow would we go on fixing this? Personally I think a simple thing like this would work:\r\nhttps://github.com/doctrine/DoctrineModule/blob/master/src/DoctrineModule/Form/Element/Proxy.php#L454\r\n\r\nSimply adding a scalar type check beforehand.\r\n\r\n```\r\n        if (false === is_scalar($value)) {\r\n            // Maybe do a check if __toString() exists and if not exception?\r\n            $value = (string) $value;\r\n        }\r\n\r\n        return $value;\r\n```\r\n\r\nWhat do you think? ping @gianarb "},"comment":{"url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/comments/225551928","html_url":"https://github.com/doctrine/DoctrineModule/issues/544#issuecomment-225551928","issue_url":"https://api.github.com/repos/doctrine/DoctrineModule/issues/544","id":225551928,"user":{"login":"maglnet","id":4430279,"avatar_url":"https://avatars.githubusercontent.com/u/4430279?v=3","gravatar_id":"","url":"https://api.github.com/users/maglnet","html_url":"https://github.com/maglnet","followers_url":"https://api.github.com/users/maglnet/followers","following_url":"https://api.github.com/users/maglnet/following{/other_user}","gists_url":"https://api.github.com/users/maglnet/gists{/gist_id}","starred_url":"https://api.github.com/users/maglnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maglnet/subscriptions","organizations_url":"https://api.github.com/users/maglnet/orgs","repos_url":"https://api.github.com/users/maglnet/repos","events_url":"https://api.github.com/users/maglnet/events{/privacy}","received_events_url":"https://api.github.com/users/maglnet/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T11:08:15Z","updated_at":"2016-06-13T11:08:15Z","body":"@rieschl perhaps this works for you:\r\nhttps://gist.github.com/maglnet/be6966e397237b4c38a3729ff4c04403\r\n"}}
{"actor":{"display_login":"maglnet"}}