title: Invalid Form in Symfony with no errors
body: <p>This is the first time I've tried to use forms with Symfony, and I've got myself completely stuck.  I'm sure it will be something simple.</p>
  
  <p>I have a simple controller set up as so (using Symfony 2.7 and FOSRestBundle 2.0):</p>
  
  <pre><code>/**
   * @View()
   */
  public function postPredictionsAction(Request $request)
  {
      $form = $this-&gt;createFormBuilder(['id' =&gt; '1', 'description' =&gt; '2'])
          -&gt;add('id', 'text')
          -&gt;add('description', 'text')
          -&gt;getForm();
      $form-&gt;handleRequest($request);
  
      if ($form-&gt;isValid()) {
          return true;
      }
  
      print_r($request-&gt;request-&gt;all());
      print_r($form-&gt;getData());
      print_r((string) $form-&gt;getErrors(true, false));
  
      return false;
  }
  </code></pre>
  
  <p>But my form is always invalid, even though there are no errors:</p>
  
  <pre><code>curl -X POST --data 'id=foo&amp;description=bar' http://localhost:8080/bracket/predictions
  Array
  (
      [id] =&gt; foo
      [description] =&gt; bar
  )
  Array
  (
      [id] =&gt; 1
      [description] =&gt; 2
  )
  false
  </code></pre>
  
  <p>So it looks like my request data is not making it in to the form, and for some reason the form is not valid, even though there are no errors printed at all.</p>
  
  <p>EDIT: After a lot of faffing around, it seems that the <code>handleRequest()</code> call has determined that the form has not been submitted, and therefore is not validated - meaning I get in to the situation described above.</p>
  
  <p>So instead of <code>handleRequest()</code> I can replace it with <code>submit()</code> as a work around.  This is described as deprecated behaviour by the docs:</p>
  
  <p><a href="http://symfony.com/doc/2.7/cookbook/form/direct_submit.html#cookbook-form-submit-request" rel="nofollow">http://symfony.com/doc/2.7/cookbook/form/direct_submit.html#cookbook-form-submit-request</a></p>
  
  <p>So I'm clearly still doing something wrong, but I can't see what it is from the Symfony docs.</p>