{"action":"created","comment":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/59689019","id":59689019,"diff_hunk":"@@ -29,6 +29,7 @@\n         \"sonata-project/core-bundle\": \"~2.3,>=2.3.1\"\n     },\n     \"require-dev\": {\n+        \"rhumsaa/uuid\": \"^2.8\",","path":"composer.json","position":4,"original_position":4,"commit_id":"b335974a473d4afb3dac99503eb8b736521cd81e","original_commit_id":"b335974a473d4afb3dac99503eb8b736521cd81e","user":{"login":"acrobat","id":1374857,"avatar_url":"https://avatars.githubusercontent.com/u/1374857?v=3","gravatar_id":"","url":"https://api.github.com/users/acrobat","html_url":"https://github.com/acrobat","followers_url":"https://api.github.com/users/acrobat/followers","following_url":"https://api.github.com/users/acrobat/following{/other_user}","gists_url":"https://api.github.com/users/acrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/acrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrobat/subscriptions","organizations_url":"https://api.github.com/users/acrobat/orgs","repos_url":"https://api.github.com/users/acrobat/repos","events_url":"https://api.github.com/users/acrobat/events{/privacy}","received_events_url":"https://api.github.com/users/acrobat/received_events","type":"User","site_admin":false},"body":"I had to use the old uuid lib from Rhumsaa instead of Ramsey's to keep the tests compatible with php 5.3\r\n\r\nI use the lib because I use a uuid class to generate uuid (and have it mapped by doctrine) to test the changes.","created_at":"2016-04-14T09:41:53Z","updated_at":"2016-04-14T09:41:53Z","html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523#discussion_r59689019","pull_request_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523","_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/59689019"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523#discussion_r59689019"},"pull_request":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523"}}},"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523","id":57780239,"html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523","diff_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523.diff","patch_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/523","number":523,"state":"open","locked":false,"title":"Get database value of identifier to support other identifier type classes","user":{"login":"acrobat","id":1374857,"avatar_url":"https://avatars.githubusercontent.com/u/1374857?v=3","gravatar_id":"","url":"https://api.github.com/users/acrobat","html_url":"https://github.com/acrobat","followers_url":"https://api.github.com/users/acrobat/followers","following_url":"https://api.github.com/users/acrobat/following{/other_user}","gists_url":"https://api.github.com/users/acrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/acrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrobat/subscriptions","organizations_url":"https://api.github.com/users/acrobat/orgs","repos_url":"https://api.github.com/users/acrobat/repos","events_url":"https://api.github.com/users/acrobat/events{/privacy}","received_events_url":"https://api.github.com/users/acrobat/received_events","type":"User","site_admin":false},"body":"I came across this issue/case when using an entity with uuid identifier and prefilled (uuid generated in the entity) identifier\r\n\r\nExample:\r\n```php\r\nuse Ramsey\\Uuid\\Uuid;\r\n\r\nclass Example\r\n{\r\n    /**\r\n     * @var \\Ramsey\\Uuid\\Uuid\r\n     *\r\n     * @ORM\\Column(type=\"uuid\")\r\n     * @ORM\\Id\r\n     */\r\n    private $id;\r\n\r\n    public function __construct()\r\n    {\r\n        $this->id = Uuid::uuid4();\r\n    }\r\n}\r\n```\r\n\r\nProblems:\r\n- Create page could not be opened (as the identifier class could not be resolved)\r\n- prefilled identifier caused the code to think it was editing an existing item\r\n\r\nFixes:\r\n- Use the database value of each type to display the entity\r\n- Check with the unit of work if an entity is managed or not (to check if it is create or edit)\r\n- I had to use the old uuid lib from Rhumsaa instead of Ramsey's to keep the tests compatible with php 5.3\r\n\r\nI've also added tests to check this behavior. Based this pr on changes in #481.","created_at":"2016-01-31T21:07:50Z","updated_at":"2016-04-14T09:41:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dde710154f76d869ecd05f933da888e969432a24","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523/comments","review_comment_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/523/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/b335974a473d4afb3dac99503eb8b736521cd81e","head":{"label":"acrobat:identifier_class_fix","ref":"identifier_class_fix","sha":"b335974a473d4afb3dac99503eb8b736521cd81e","user":{"login":"acrobat","id":1374857,"avatar_url":"https://avatars.githubusercontent.com/u/1374857?v=3","gravatar_id":"","url":"https://api.github.com/users/acrobat","html_url":"https://github.com/acrobat","followers_url":"https://api.github.com/users/acrobat/followers","following_url":"https://api.github.com/users/acrobat/following{/other_user}","gists_url":"https://api.github.com/users/acrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/acrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrobat/subscriptions","organizations_url":"https://api.github.com/users/acrobat/orgs","repos_url":"https://api.github.com/users/acrobat/repos","events_url":"https://api.github.com/users/acrobat/events{/privacy}","received_events_url":"https://api.github.com/users/acrobat/received_events","type":"User","site_admin":false},"repo":{"id":50744264,"name":"SonataDoctrineORMAdminBundle","full_name":"acrobat/SonataDoctrineORMAdminBundle","owner":{"login":"acrobat","id":1374857,"avatar_url":"https://avatars.githubusercontent.com/u/1374857?v=3","gravatar_id":"","url":"https://api.github.com/users/acrobat","html_url":"https://github.com/acrobat","followers_url":"https://api.github.com/users/acrobat/followers","following_url":"https://api.github.com/users/acrobat/following{/other_user}","gists_url":"https://api.github.com/users/acrobat/gists{/gist_id}","starred_url":"https://api.github.com/users/acrobat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acrobat/subscriptions","organizations_url":"https://api.github.com/users/acrobat/orgs","repos_url":"https://api.github.com/users/acrobat/repos","events_url":"https://api.github.com/users/acrobat/events{/privacy}","received_events_url":"https://api.github.com/users/acrobat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acrobat/SonataDoctrineORMAdminBundle","description":"Integrates the Doctrine ORM Project into the AdminBundle","fork":true,"url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle","forks_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/forks","keys_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/teams","hooks_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/events","assignees_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/tags","blobs_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/languages","stargazers_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/subscription","commits_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/merges","archive_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/downloads","issues_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/releases{/id}","deployments_url":"https://api.github.com/repos/acrobat/SonataDoctrineORMAdminBundle/deployments","created_at":"2016-01-30T20:47:16Z","updated_at":"2016-01-30T20:47:17Z","pushed_at":"2016-04-14T09:26:47Z","git_url":"git://github.com/acrobat/SonataDoctrineORMAdminBundle.git","ssh_url":"git@github.com:acrobat/SonataDoctrineORMAdminBundle.git","clone_url":"https://github.com/acrobat/SonataDoctrineORMAdminBundle.git","svn_url":"https://github.com/acrobat/SonataDoctrineORMAdminBundle","homepage":"http://sonata-project.org/bundles/doctrine-orm-admin","size":755,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sonata-project:master","ref":"master","sha":"9e79f15e43512b4c809a9029a5c0247e7354a277","user":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"repo":{"id":2687013,"name":"SonataDoctrineORMAdminBundle","full_name":"sonata-project/SonataDoctrineORMAdminBundle","owner":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle","description":"Integrates the Doctrine ORM Project into the AdminBundle","fork":false,"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle","forks_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/forks","keys_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/teams","hooks_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/events","assignees_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/tags","blobs_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/languages","stargazers_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/subscription","commits_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/merges","archive_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/downloads","issues_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/releases{/id}","deployments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/deployments","created_at":"2011-11-01T11:12:33Z","updated_at":"2016-04-06T12:28:09Z","pushed_at":"2016-04-14T09:26:47Z","git_url":"git://github.com/sonata-project/SonataDoctrineORMAdminBundle.git","ssh_url":"git@github.com:sonata-project/SonataDoctrineORMAdminBundle.git","clone_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle.git","svn_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle","homepage":"http://sonata-project.org/bundles/doctrine-orm-admin","size":1378,"stargazers_count":166,"watchers_count":166,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":258,"mirror_url":null,"open_issues_count":133,"forks":258,"open_issues":133,"watchers":166,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/523"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/523"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/523/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523/comments"},"review_comment":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/523/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/b335974a473d4afb3dac99503eb8b736521cd81e"}}}}