title: Symfony2 FOSUserBundle override profile form : field form empty?
body: <p>I overrided registration form from FOSUserBundle with additionals fields: it works well.</p>
  
  <p>When I apply the same logic to override Profile Form : the form appears well with my additionals  fields but all is empty (the fields do not contain values ​​of the connected user).</p>
  
  <p>Note: when I use the default form from the bundle the profile form contains the values ​​of the connected user.</p>
  
  <p>Is there a specific action compared to override the registration form to retrieve the values ​​of the connected user ?</p>
  
  <p>HERE IS CODE : </p>
  
  <h1>src/Vn/UserBundle/Resources/config/services.yml</h1>
  
  <pre><code>services:
   ...
    vn_user.profile.form.type:
      class: Vn\UserBundle\Form\Type\ProfileFormType
      arguments: [%fos_user.model.user.class%]
      tags:
          - { name: form.type, alias: vn_user_profile }
  
    vn_user.form.handler.profile:
      class: Vn\UserBundle\Form\Handler\ProfileFormHandler
      arguments: ["@fos_user.profile.form", "@request", "@fos_user.user_manager"]
      scope: request
      public: false 
  </code></pre>
  
  <h1>symfony/app/config/config.yml</h1>
  
  <pre><code>  fos_user:
    ...
    profile:
          form:
                type: vn_user_profile
                handler: vn_user.form.handler.profile
  </code></pre>
  
  <h1>src/Vn/UserBundle/Form/Type/ProfileFormType.php</h1>
  
  <pre><code>  namespace Vn\UserBundle\Form\Type;
  
    use Symfony\Component\Form\FormBuilder;
    use FOS\UserBundle\Form\Type\ProfileFormType as BaseType;
  
    class ProfileFormType extends BaseType
    {    
        public function buildUserForm(FormBuilder $builder, array $options)
        {        
        parent::buildUserForm($builder, $options);
  
            // custom field       
            $builder-&gt;add('profile',new MyProfileFormType(),array(
                      'label' =&gt; 'PROFILE'
                      ));
  
        }
  
        public function getName()
        {
            return 'vn_user_profile';
        }
    }
  </code></pre>
  
  <h1>src/Vn/UserBundle/Form/Type/MyProfileFormType.php</h1>
  
  <pre><code>namespace Vn\UserBundle\Form\Type;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilder;
  
  class MyProfileFormType extends AbstractType
  {
  
      public function buildForm(FormBuilder $builder, array $options)
      {
      $builder-&gt;add('birthday','birthday', array(
          'input' =&gt; 'array',
          'widget' =&gt; 'choice',
  
          'label'  =&gt; 'Birthday',
          ))
          -&gt;add('firstname','text', array(
          'trim' =&gt; true,
          'label'  =&gt; 'Firstname',
          ))
          -&gt;add('lastname','text', array(
          'trim' =&gt; true,
          'label'  =&gt; 'Lastname',
          ))
          -&gt;add('gender','choice', array(
          'choices'   =&gt; array('1' =&gt; 'Male', '2' =&gt; 'Female'),
          'expanded'  =&gt; true,
          'required'  =&gt; true,
          'label'  =&gt; 'Vous êtes',
          ));
      }
  
      public function getName()
      {
          return 'vn_user_myprofile';
      }
  
  
      public function getDefaultOptions(array $options)
      {
          return array(
              'data_class' =&gt; 'Vn\UserBundle\Document\Profile',
  
          );
      }
  
  }
  </code></pre>