{"action":"opened","issue":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/issues/1811","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/issues/1811/labels{/name}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/issues/1811/comments","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/issues/1811/events","html_url":"https://github.com/FriendsOfSymfony/FOSUserBundle/issues/1811","id":69798165,"number":1811,"title":"Add custom fields - not working","user":{"login":"averichev","id":5820708,"avatar_url":"https://avatars.githubusercontent.com/u/5820708?v=3","gravatar_id":"","url":"https://api.github.com/users/averichev","html_url":"https://github.com/averichev","followers_url":"https://api.github.com/users/averichev/followers","following_url":"https://api.github.com/users/averichev/following{/other_user}","gists_url":"https://api.github.com/users/averichev/gists{/gist_id}","starred_url":"https://api.github.com/users/averichev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/averichev/subscriptions","organizations_url":"https://api.github.com/users/averichev/orgs","repos_url":"https://api.github.com/users/averichev/repos","events_url":"https://api.github.com/users/averichev/events{/privacy}","received_events_url":"https://api.github.com/users/averichev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-21T09:46:30Z","updated_at":"2015-04-21T09:46:30Z","closed_at":null,"body":"I try adding custom user fields: name, surname, second_name, post\r\n\r\ni try adding custom user fields\r\nwhen i submit form, custom fields not changed, but changed email (for example)\r\n\r\nUser.orm.yml\r\n\r\n```yml\r\nApp\\UserBundle\\Entity\\User:\r\n    type: entity\r\n    table: null\r\n    id:\r\n        id:\r\n            type: integer\r\n            id: true\r\n            generator:\r\n                strategy: AUTO\r\n    fields:\r\n        name:\r\n            type: string\r\n            length: 100\r\n            nullable: true\r\n        surname:\r\n            type: string\r\n            length: 100\r\n            nullable: true\r\n        second_name:\r\n            type: string\r\n            length: 100\r\n            nullable: true\r\n        post:\r\n            type: string\r\n            length: 100\r\n            nullable: true\r\n    lifecycleCallbacks: {  }\r\n```\r\n\r\nMy entity file User.php\r\n\r\n```php\r\n<?php\r\n\r\nnamespace App\\UserBundle\\Entity;\r\nuse FOS\\UserBundle\\Model\\User as BaseUser;\r\n\r\n\r\nclass User extends BaseUser\r\n{\r\n\r\n    protected $id;\r\n\r\n    public function __construct()\r\n    {\r\n        parent::__construct();\r\n        // your own logic\r\n    }\r\n    /**\r\n     * @var string\r\n     */\r\n    private $name;\r\n\r\n    /**\r\n     * @var string\r\n     */\r\n    private $surname;\r\n\r\n    /**\r\n     * @var string\r\n     */\r\n    private $second_name;\r\n\r\n    /**\r\n     * @var string\r\n     */\r\n    private $post;\r\n\r\n\r\n    /**\r\n     * Get id\r\n     *\r\n     * @return integer \r\n     */\r\n    public function getId()\r\n    {\r\n        return $this->id;\r\n    }\r\n\r\n    /**\r\n     * Set name\r\n     *\r\n     * @param string $name\r\n     * @return User\r\n     */\r\n    public function setName($name)\r\n    {\r\n        $this->name = $name;\r\n\r\n        return $this;\r\n    }\r\n\r\n    /**\r\n     * Get name\r\n     *\r\n     * @return string \r\n     */\r\n    public function getName()\r\n    {\r\n        return $this->name;\r\n    }\r\n\r\n    /**\r\n     * Set surname\r\n     *\r\n     * @param string $surname\r\n     * @return User\r\n     */\r\n    public function setSurname($surname)\r\n    {\r\n        $this->surname = $surname;\r\n\r\n        return $this;\r\n    }\r\n\r\n    /**\r\n     * Get surname\r\n     *\r\n     * @return string \r\n     */\r\n    public function getSurname()\r\n    {\r\n        return $this->surname;\r\n    }\r\n\r\n    /**\r\n     * Set second_name\r\n     *\r\n     * @param string $secondName\r\n     * @return User\r\n     */\r\n    public function setSecondName($secondName)\r\n    {\r\n        $this->second_name = $secondName;\r\n\r\n        return $this;\r\n    }\r\n\r\n    /**\r\n     * Get second_name\r\n     *\r\n     * @return string \r\n     */\r\n    public function getSecondName()\r\n    {\r\n        return $this->second_name;\r\n    }\r\n\r\n    /**\r\n     * Set post\r\n     *\r\n     * @param string $post\r\n     * @return User\r\n     */\r\n    public function setPost($post)\r\n    {\r\n        $this->post = $post;\r\n\r\n        return $this;\r\n    }\r\n\r\n    /**\r\n     * Get post\r\n     *\r\n     * @return string \r\n     */\r\n    public function getPost()\r\n    {\r\n        return $this->post;\r\n    }\r\n}\r\n```\r\n\r\ncontroller\r\n```php\r\n\r\n    /**\r\n     * Edits an existing User entity.\r\n     *\r\n     */\r\n    public function updateAction(Request $request, $id)\r\n    {\r\n        $em = $this->getDoctrine()->getManager();\r\n\r\n        $entity = $em->getRepository('OrchestraUserBundle:User')->find($id);\r\n\r\n        if (!$entity) {\r\n            throw $this->createNotFoundException('Unable to find User entity.');\r\n        }\r\n\r\n        $deleteForm = $this->createDeleteForm($id);\r\n        $editForm = $this->createEditForm($entity);\r\n        $editForm->handleRequest($request);\r\n\r\n        if ($editForm->isValid()) {\r\n            $em->flush();\r\n            return $this->redirect($this->generateUrl('admin_user_edit', array('id' => $id)));\r\n        }\r\n\r\n        return $this->render('AppUserBundle:User:edit.html.twig', array(\r\n            'entity' => $entity,\r\n            'edit_form' => $editForm->createView(),\r\n            'delete_form' => $deleteForm->createView(),\r\n        ));\r\n    }\r\n\r\n\r\n```"}}