{"action":"created","comment":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/72784412","id":72784412,"diff_hunk":"@@ -65,12 +65,27 @@ public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInter\n         $fieldDescription->setAdmin($admin);\n         $fieldDescription->setOption('edit', $fieldDescription->getOption('edit', 'standard'));\n \n-        if (in_array($fieldDescription->getMappingType(), array(ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_MANY, ClassMetadataInfo::MANY_TO_ONE, ClassMetadataInfo::ONE_TO_ONE))) {\n+        if ($this->hasAssociation($fieldDescription) || $fieldDescription->getOption('admin_code')) {","path":"Builder/FormContractor.php","position":5,"original_position":5,"commit_id":"1f961e44d2c866488393b6ae18d3a6ed3402defa","original_commit_id":"1f961e44d2c866488393b6ae18d3a6ed3402defa","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":"I think you're right, logical fail on my part, sorry.","created_at":"2016-07-29T12:37:07Z","updated_at":"2016-07-29T12:37:07Z","html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606#discussion_r72784412","pull_request_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606","_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/comments/72784412"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606#discussion_r72784412"},"pull_request":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606"}}},"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606","id":79350996,"html_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606","diff_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606.diff","patch_url":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/606","number":606,"state":"open","locked":false,"title":"Allow not mapped field to use `admin_code` option","user":{"login":"itcraftsmanpl","id":8239917,"avatar_url":"https://avatars.githubusercontent.com/u/8239917?v=3","gravatar_id":"","url":"https://api.github.com/users/itcraftsmanpl","html_url":"https://github.com/itcraftsmanpl","followers_url":"https://api.github.com/users/itcraftsmanpl/followers","following_url":"https://api.github.com/users/itcraftsmanpl/following{/other_user}","gists_url":"https://api.github.com/users/itcraftsmanpl/gists{/gist_id}","starred_url":"https://api.github.com/users/itcraftsmanpl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itcraftsmanpl/subscriptions","organizations_url":"https://api.github.com/users/itcraftsmanpl/orgs","repos_url":"https://api.github.com/users/itcraftsmanpl/repos","events_url":"https://api.github.com/users/itcraftsmanpl/events{/privacy}","received_events_url":"https://api.github.com/users/itcraftsmanpl/received_events","type":"User","site_admin":false},"body":"I am targetting this branch, because it is a bug fix.\r\n\r\n## Changelog\r\n\r\n### Fixed\r\n\r\n- fixed: allow not mapped field to use `admin_code` option for `sonata_type_model_list`\r\n\r\n## Subject\r\n\r\nWhen you have field with option `mapped => false`, example:\r\n\r\n```php\r\n                   ->add('company', 'sonata_type_model_list', [\r\n                        'btn_add' => false,\r\n                        'btn_delete' => false,\r\n                        'mapped' => false,\r\n                        'class' => Company::class,\r\n                    ], [\r\n                        'admin_code' => 'sonata.admin.company',\r\n                    ])\r\n```\r\n\r\n\r\n\r\nThis error occurs:\r\n```\r\nImpossible to invoke a method (\"id\") on a null variable in SonataDoctrineORMAdminBundle:Form:form_admin_fields.html.twig at line 59\r\n```\r\n\r\nThis path fix error and allow not mapped filed work with `sonata_type_model_list`.","created_at":"2016-07-29T12:22:02Z","updated_at":"2016-07-29T12:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2452b15cd8e41d88f4e6fa81994e779a75fcf026","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606/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/606/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/1f961e44d2c866488393b6ae18d3a6ed3402defa","head":{"label":"da-vinci-studio:fix-admin-code","ref":"fix-admin-code","sha":"1f961e44d2c866488393b6ae18d3a6ed3402defa","user":{"login":"da-vinci-studio","id":19303296,"avatar_url":"https://avatars.githubusercontent.com/u/19303296?v=3","gravatar_id":"","url":"https://api.github.com/users/da-vinci-studio","html_url":"https://github.com/da-vinci-studio","followers_url":"https://api.github.com/users/da-vinci-studio/followers","following_url":"https://api.github.com/users/da-vinci-studio/following{/other_user}","gists_url":"https://api.github.com/users/da-vinci-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/da-vinci-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-vinci-studio/subscriptions","organizations_url":"https://api.github.com/users/da-vinci-studio/orgs","repos_url":"https://api.github.com/users/da-vinci-studio/repos","events_url":"https://api.github.com/users/da-vinci-studio/events{/privacy}","received_events_url":"https://api.github.com/users/da-vinci-studio/received_events","type":"Organization","site_admin":false},"repo":{"id":64477213,"name":"SonataDoctrineORMAdminBundle","full_name":"da-vinci-studio/SonataDoctrineORMAdminBundle","owner":{"login":"da-vinci-studio","id":19303296,"avatar_url":"https://avatars.githubusercontent.com/u/19303296?v=3","gravatar_id":"","url":"https://api.github.com/users/da-vinci-studio","html_url":"https://github.com/da-vinci-studio","followers_url":"https://api.github.com/users/da-vinci-studio/followers","following_url":"https://api.github.com/users/da-vinci-studio/following{/other_user}","gists_url":"https://api.github.com/users/da-vinci-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/da-vinci-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-vinci-studio/subscriptions","organizations_url":"https://api.github.com/users/da-vinci-studio/orgs","repos_url":"https://api.github.com/users/da-vinci-studio/repos","events_url":"https://api.github.com/users/da-vinci-studio/events{/privacy}","received_events_url":"https://api.github.com/users/da-vinci-studio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/da-vinci-studio/SonataDoctrineORMAdminBundle","description":"Integrates the Doctrine ORM Project into the AdminBundle","fork":true,"url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle","forks_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/forks","keys_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/teams","hooks_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/events","assignees_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/tags","blobs_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/languages","stargazers_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/subscription","commits_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/merges","archive_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/downloads","issues_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/releases{/id}","deployments_url":"https://api.github.com/repos/da-vinci-studio/SonataDoctrineORMAdminBundle/deployments","created_at":"2016-07-29T11:58:27Z","updated_at":"2016-07-29T11:58:28Z","pushed_at":"2016-07-29T12:11:59Z","git_url":"git://github.com/da-vinci-studio/SonataDoctrineORMAdminBundle.git","ssh_url":"git@github.com:da-vinci-studio/SonataDoctrineORMAdminBundle.git","clone_url":"https://github.com/da-vinci-studio/SonataDoctrineORMAdminBundle.git","svn_url":"https://github.com/da-vinci-studio/SonataDoctrineORMAdminBundle","homepage":"http://sonata-project.org/bundles/doctrine-orm-admin","size":1576,"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":"3.x"}},"base":{"label":"sonata-project:3.x","ref":"3.x","sha":"a2ba13020b249cf5f810e0cce8a1805d642dd25d","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-05-22T17:51:13Z","pushed_at":"2016-07-29T12:22:02Z","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":1576,"stargazers_count":170,"watchers_count":170,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":277,"mirror_url":null,"open_issues_count":49,"forks":277,"open_issues":49,"watchers":170,"default_branch":"3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606"},"html":{"href":"https://github.com/sonata-project/SonataDoctrineORMAdminBundle/pull/606"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/606"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/issues/606/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/pulls/606/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/606/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataDoctrineORMAdminBundle/statuses/1f961e44d2c866488393b6ae18d3a6ed3402defa"}}}}
{"actor":{"display_login":"greg0ire"}}