{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2585","repository_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2585/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2585/comments","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2585/events","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/2585","id":50058534,"number":2585,"title":"Unable to use the sonata_type_admin field - Field not linked to an admin","user":{"login":"aguidis","id":1856652,"avatar_url":"https://avatars.githubusercontent.com/u/1856652?v=3","gravatar_id":"","url":"https://api.github.com/users/aguidis","html_url":"https://github.com/aguidis","followers_url":"https://api.github.com/users/aguidis/followers","following_url":"https://api.github.com/users/aguidis/following{/other_user}","gists_url":"https://api.github.com/users/aguidis/gists{/gist_id}","starred_url":"https://api.github.com/users/aguidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aguidis/subscriptions","organizations_url":"https://api.github.com/users/aguidis/orgs","repos_url":"https://api.github.com/users/aguidis/repos","events_url":"https://api.github.com/users/aguidis/events{/privacy}","received_events_url":"https://api.github.com/users/aguidis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2014-11-25T17:28:17Z","updated_at":"2016-08-05T12:30:24Z","closed_at":null,"body":"I have an entity \"Author\" and \"Image\" with a simple OneToOne relation.\r\nI tried to embed an Admin class in my Author admin class for the \"image\" field which is linked to the Image entity. \r\n\r\nThe mapping betweens the two classes is correct. \r\n\r\nI created an Admin class for each entity :\r\n\r\n- ImageAdmin works correctly. When I add a new image, the database is updated and the image is uploaded.\r\n\r\n- Then I create the AuthorAdmin thanks to the documentation (http://sonata-project.org/bundles/admin/master/doc/reference/form_types.html#sonata-type-admin). But I always have this message : \r\n\r\n> The current field `image` is not linked to an admin. Please create one for the target entity : ``\r\n\r\n\r\nThe admin services are registred in the admin.yml (I used http://sonata-project.org/bundles/admin/master/doc/reference/form_types.html#sonata-type-admin) :\r\n\r\n```yml\r\nservices:\r\n    sonata.admin.author:\r\n        class: Project\\BackendBundle\\Admin\\AuthorAdmin\r\n        tags:\r\n            - { name: sonata.admin, manager_type: orm, group: \"Content\", label: \"Author\" }\r\n        arguments:\r\n            - ~\r\n            - Project\\BackendBundle\\Entity\\Author\r\n            - ~\r\n\r\n    sonata.admin.image:\r\n        class: Project\\BackendBundle\\Admin\\ImageAdmin\r\n        tags:\r\n            - { name: sonata.admin, manager_type: orm, group: \"Content\", label: \"Image\" }\r\n        arguments:\r\n            - ~\r\n            - Project\\BackendBundle\\Entity\\Image\r\n            - 'SonataAdminBundle:CRUD'\r\n```\r\n\r\nI followed all the documentation but now I don't see the problem. I even try to pass the FieldDescription option \"admin_code\" :\r\n\r\n```php\r\n$formMapper\r\n    ->add('name', 'text', array('label' => 'Author name'))\r\n    ->add(\r\n        'image',\r\n        'sonata_type_admin',\r\n        array(),\r\n        array('admin_code' => 'sonata.admin.image')\r\n    )\r\n;\r\n```\r\nI use the lastest version of sonata admin bundle sonata-project/admin-bundle."},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments/237838087","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/2585#issuecomment-237838087","issue_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/2585","id":237838087,"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},"created_at":"2016-08-05T12:30:24Z","updated_at":"2016-08-05T12:30:24Z","body":"You should debug this line : https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/55d1f169af953cbf4c9c2933f2f0734652613561/Builder/FormContractor.php#L68"}}
{"actor":{"display_login":"greg0ire"}}