{"action":"created","comment":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/80514095","id":80514095,"diff_hunk":"@@ -376,7 +386,7 @@ public function getNormalizedIdentifier($entity)\n         }\n \n         // the entities is not managed\n-        if (!$entity /*|| !$this->getEntityManager($entity)->getUnitOfWork()->isInIdentityMap($entity) // commented for perfomance concern */) {\n+        if (!$entity || !$this->getEntityManager($entity)->getUnitOfWork()->isInIdentityMap($entity)) {","path":"Model/ModelManager.php","position":46,"original_position":46,"commit_id":"6f460e132be432f736237b3b740a8d7bf55d7099","original_commit_id":"93c34477b250bc02a1b8d30c013ad3b203e92edf","user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars.githubusercontent.com/u/657779?v=3","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"body":"Uuuuh `@doctrine` is supposed to be the doctrine registry, not the entity manager, right?","created_at":"2016-09-26T16:22:23Z","updated_at":"2016-09-26T16:22:23Z","html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547#discussion_r80514095","pull_request_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547","_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/80514095"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547#discussion_r80514095"},"pull_request":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547"}}},"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547","id":69787800,"html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547","diff_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547.diff","patch_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/547","number":547,"state":"closed","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":"_Resubmitted PR #523 to the correct branch after switching release strategy_\r\n\r\nDescription from #523:\r\n\r\n> \r\n> I came across this issue/case when using an entity with uuid identifier and prefilled (uuid generated in the entity) identifier\r\n> \r\n> Example:\r\n> ```php\r\n> use Ramsey\\Uuid\\Uuid;\r\n> \r\n> class 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\n> Problems:\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\n> Fixes:\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\n> I've also added tests to check this behavior. Based this pr on changes in #481.\r\n\r\nDone:\r\n- [x] Imported fixes from #481\r\n\r\nTodo:\r\n- [x] Rework tests so they don't rely on rhumsaa/uuid\r\n- [x] Add changelog\r\n\r\nCan someone help me a bit to get started on the mock of the uuid class and uuid doctirne type for the unittests?\r\n","created_at":"2016-05-12T06:56:45Z","updated_at":"2016-09-26T16:22:23Z","closed_at":"2016-05-22T08:06:47Z","merged_at":"2016-05-22T08:06:47Z","merge_commit_sha":"94cae3157b94db89e101318c49125d77296a52a4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547/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/547/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/6f460e132be432f736237b3b740a8d7bf55d7099","head":{"label":"acrobat:identifier_class_fix","ref":"identifier_class_fix","sha":"6f460e132be432f736237b3b740a8d7bf55d7099","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-05-22T10:44:12Z","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":832,"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:3.x","ref":"3.x","sha":"a2c6444471aeafc82a631ae0658a67b92ba67236","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-08-25T21:48:50Z","pushed_at":"2016-09-26T01:30:05Z","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":1624,"stargazers_count":170,"watchers_count":170,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":285,"mirror_url":null,"open_issues_count":47,"forks":285,"open_issues":47,"watchers":170,"default_branch":"3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/547"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/547"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/547/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/547/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/547/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/6f460e132be432f736237b3b740a8d7bf55d7099"}}}}
{"actor":{"display_login":"greg0ire"}}