{"action":"closed","issue":{"url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/661","repository_url":"https://api.github.com/repos/dustin10/VichUploaderBundle","labels_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/661/comments","events_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/661/events","html_url":"https://github.com/dustin10/VichUploaderBundle/issues/661","id":199639393,"number":661,"title":"Symfony 3: Form error OneToMany relationship","user":{"login":"looo87","id":5213213,"avatar_url":"https://avatars.githubusercontent.com/u/5213213?v=3","gravatar_id":"","url":"https://api.github.com/users/looo87","html_url":"https://github.com/looo87","followers_url":"https://api.github.com/users/looo87/followers","following_url":"https://api.github.com/users/looo87/following{/other_user}","gists_url":"https://api.github.com/users/looo87/gists{/gist_id}","starred_url":"https://api.github.com/users/looo87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/looo87/subscriptions","organizations_url":"https://api.github.com/users/looo87/orgs","repos_url":"https://api.github.com/users/looo87/repos","events_url":"https://api.github.com/users/looo87/events{/privacy}","received_events_url":"https://api.github.com/users/looo87/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-09T19:25:15Z","updated_at":"2017-01-09T20:04:48Z","closed_at":"2017-01-09T20:04:48Z","body":"I'm using FOSUserBundle and I added an extra entity for Address and used a `OneToMany` relation between it and User entity. Everything works fine untill submit where I get this error:\r\n\r\n> Expected argument of type \"AppBundle\\Entity\\Phaddress\", \"array\" given\r\n\r\nThis is the form for address:\r\n```\r\nClass PhaddressType extends AbstractType\r\n{\r\n    public function buildForm(FormBuilderInterface $builder, array $options)\r\n    {\r\n        $builder->add('address_first')\r\n            ->add('address_second')\r\n            ->add('city')\r\n            ->add('state')\r\n            ->add('zip')\r\n            ->add('country')\r\n            ->add('phone_cel')\r\n            ->add('phone_nb');\r\n    }\r\n\r\n    public function setDefaultOptions(OptionsResolverInterface $resolver)\r\n    {\r\n        $resolver->setDefaults(array('data_class'=>'AppBundle\\Entity\\Phaddress'));\r\n    }\r\n\r\n    public function getName()\r\n    {\r\n        return 'appbundle_phaddress';\r\n    }\r\n}\r\n```\r\n\r\nAnd this is my main form ( with address form included):\r\n\r\n```\r\nprotected function buildUserForm(FormBuilderInterface $builder, array $options)\r\n{\r\n    $builder\r\n        ->add('phaddress', PhaddressType::class, array('required' => false))\r\n        ->add('firstName', null, array('label' => 'First Name'))\r\n        ->add('lastName', null, array('label' => 'Last Name'))\r\n        ->add('username', null, array('label' => 'Username'))\r\n        ->add('email', LegacyFormHelper::getType('Symfony\\Component\\Form\\Extension\\Core\\Type\\EmailType'), array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))\r\n    ;\r\n}\r\n```\r\nAnd here are the entities (links): [https://github.com/looo87/Store/blob/Second/src/AppBundle/Entity/Phaddress.php](url)\r\n[https://github.com/looo87/Store/blob/Second/src/AppBundle/Entity/User.php](url)"}}
{"actor":{"display_login":"looo87"}}