{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/16486","labels_url":"https://api.github.com/repos/symfony/symfony/issues/16486/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/16486/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/16486/events","html_url":"https://github.com/symfony/symfony/issues/16486","id":115486829,"number":16486,"title":"entity type in my form is never valid","user":{"login":"bilougit","id":1367298,"avatar_url":"https://avatars.githubusercontent.com/u/1367298?v=3","gravatar_id":"","url":"https://api.github.com/users/bilougit","html_url":"https://github.com/bilougit","followers_url":"https://api.github.com/users/bilougit/followers","following_url":"https://api.github.com/users/bilougit/following{/other_user}","gists_url":"https://api.github.com/users/bilougit/gists{/gist_id}","starred_url":"https://api.github.com/users/bilougit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilougit/subscriptions","organizations_url":"https://api.github.com/users/bilougit/orgs","repos_url":"https://api.github.com/users/bilougit/repos","events_url":"https://api.github.com/users/bilougit/events{/privacy}","received_events_url":"https://api.github.com/users/bilougit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-06T11:22:06Z","updated_at":"2015-11-06T11:44:54Z","closed_at":null,"body":"```php\r\n// *************************\r\n// Entity\r\n// *************************\r\nclass Wheel {\r\n    ....\r\n    /**\r\n     * @ORM\\ManyToOne(targetEntity=\"Car\")\r\n     */\r\n    protected car;\r\n    ...\r\n}\r\n\r\n// *************************\r\n// Form\r\n// *************************\r\nclass WheelType extends AbstractType {\r\n    public function buildForm(FormBuilderInterface $builder, array $options) {\r\n        ....\r\n        $form->add('car', 'entity', array(\r\n            'class' => 'namespace\\Car',\r\n        );\r\n    ...\r\n\r\n// *************************\r\n// Controller\r\n// *************************\r\n$form->handleRequest($request);\r\ndump($form->getErrors(true));\r\nexit;\r\n\r\n// *************************\r\n// Twig\r\n// *************************\r\n {{ form_row(form.car) }}\r\n\r\n// *************************\r\n// OUPUT\r\n// *************************\r\nFormErrorIterator {#1897 ▼\r\n  -form: Form {#1861 ▶}\r\n  -errors: array:1 [▼\r\n    0 => FormError {#2083 ▼\r\n      -message: \"This value is not valid.\"\r\n      #messageTemplate: \"This value is not valid.\"\r\n      #messageParameters: array:1 [▼\r\n        \"{{ value }}\" => \"BMW\"\r\n      ]\r\n      #messagePluralization: null\r\n      -cause: ConstraintViolation {#2094 ▼\r\n        -message: \"This value is not valid.\"\r\n        -messageTemplate: \"This value is not valid.\"\r\n        -parameters: array:1 [▶]\r\n        -plural: null\r\n        -root: Form {#1861}\r\n        -propertyPath: \"children[car]\"\r\n        -invalidValue: \"BMW\"\r\n        -constraint: Form {#1999 ▶}\r\n        -code: 1\r\n        -cause: TransformationFailedException {#1879 ▼\r\n          #message: \"Unable to reverse value for property path \"car\": The choice \"BMW\" does not exist or is not unique\"\r\n```\r\n\r\nThis is used to work before I migrate to symfony2.7. I'm really clueless about where this error comes from"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/154391084","html_url":"https://github.com/symfony/symfony/issues/16486#issuecomment-154391084","issue_url":"https://api.github.com/repos/symfony/symfony/issues/16486","id":154391084,"user":{"login":"bilougit","id":1367298,"avatar_url":"https://avatars.githubusercontent.com/u/1367298?v=3","gravatar_id":"","url":"https://api.github.com/users/bilougit","html_url":"https://github.com/bilougit","followers_url":"https://api.github.com/users/bilougit/followers","following_url":"https://api.github.com/users/bilougit/following{/other_user}","gists_url":"https://api.github.com/users/bilougit/gists{/gist_id}","starred_url":"https://api.github.com/users/bilougit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bilougit/subscriptions","organizations_url":"https://api.github.com/users/bilougit/orgs","repos_url":"https://api.github.com/users/bilougit/repos","events_url":"https://api.github.com/users/bilougit/events{/privacy}","received_events_url":"https://api.github.com/users/bilougit/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T11:44:54Z","updated_at":"2015-11-06T11:44:54Z","body":"No I don't. No data transformers and no listeners/subscribers. However the primary key of my entity car is special\r\n```php\r\n    /**\r\n     * @ORM\\Column(type=\"string\", length=2)\r\n     * @ORM\\Id\r\n     */\r\n    protected $id;\r\n```\r\n"}}