title: symfony2 form hidden row
body: <p>I'm trying to put two hidden fields in a form for a particular user. I have this code:</p>
  
  <pre><code>&lt;div id="mio_miobundle_empleadotype"&gt;
  {{ form_row(edit_form.dni) }}
  {{ form_row(edit_form.nombre) }}
  {{ form_row(edit_form.username) }}
  {{ form_row(edit_form.apellido1) }}
  {{ form_row(edit_form.apellido2) }}
  {{ form_row(edit_form.localidad) }}
  {{ form_row(edit_form.provincia) }}
  {{ form_row(edit_form.telefono) }}
  {{ form_row(edit_form.movil) }}
  {{ form_row(edit_form.email) }}
  {{ form_row(edit_form.direccion) }}
  {% if is_granted('ROLE_A') %}     
        {{ form_row(edit_form.activo) }}
        {{ form_row(edit_form.role) }}
  {%endif%}
  {{ form_row(edit_form.password) }}
  </code></pre>
  
  <p>and: </p>
  
  <pre><code>$builder
              -&gt;add('dni','text',array('label' =&gt; 'Dni'))
              -&gt;add('nombre','text',array('label' =&gt; 'Nombre'))
              -&gt;add('username','text',array('label' =&gt; 'Usuario'))
              -&gt;add('apellido1','text',array('label' =&gt; 'Apellido1'))
              -&gt;add('apellido2','text',array('label' =&gt; 'Apellido2'))
              -&gt;add('email','email',array('label' =&gt; 'Email'))
              -&gt;add('localidad','text',array('label' =&gt; 'Localidad'))
              -&gt;add('provincia','text',array('label' =&gt; 'Provincia'))
              -&gt;add('telefono','text',array('label' =&gt; 'Teléfono'))
              -&gt;add('movil','text',array('label' =&gt; 'Móvil'))
              -&gt;add('direccion','text',array('label' =&gt; 'Dirección'))
              -&gt;add('activo')
              -&gt;add('role')
              -&gt;add('password', 'repeated', array('first_name' =&gt; 'Nueva contraseña','second_name' =&gt; 'Repite contraseña','type' =&gt; 'password' ,'invalid_message'=&gt; 'Las contraseñas deben ser iguales.'))
          ;
      }
  </code></pre>
  
  <p>but I get this error:</p>
  
  <blockquote>
    <p>Catchable Fatal Error: Argument 1 passed to <code>mio\mioBundle\Entity\Empleado::setRole()</code> must be an instance of <code>mio\mioBundle\Entity\Role</code>, <code>null</code> given, called in /var/www/Symfony/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php on line 347 and defined in /var/www/Symfony/src/mio/mioBundle/Entity/Empleado.php line 289</p>
  </blockquote>
  
  <p>I say that because I have to fill in the state are any help?</p>