title: Adding 'choice' option to 'entity' type form field invalidates form -- Symfony2
body: <p>I've run into this issue which I can't resolve.</p>
  
  <p>On one of my forms, there is a requirement to filter the entities.</p>
  
  <p>A bit of background:</p>
  
  <p>The form is to add a new task to a workflow step. The tasks that can be selected depend on what stage in the workflow the user is at, what product is assigned to the workflow and the company that manages that workflow.</p>
  
  <p>I tried adding in the filtering query into the 'query_builder' section, and I have tried to put the query result from the entity repository into the 'choices' section in the array.</p>
  
  <p>However, the form always comes back saying that the field I'm working on is invalid. The most puzzling part is, without the 'choices' field, as in, when it's bringing in ALL the records for that entity, the select box is exactly the same (with a few extra records) - the name, and pattern of how it's written. And that works fine. So I have absolutely no idea of what's going on.</p>
  
  <p>The form element code:</p>
  
  <pre><code>-&gt;add('instructionAction', 'entity', array(
              'label' =&gt; 'Action',
              'empty_value' =&gt; 'Select Action',
              'required' =&gt; true,
              'class' =&gt; 'ApplicationTrackpadCommonBundle:InstructionAction',
              'property' =&gt; 'description',
              'choices' =&gt; $this-&gt;instructionActionRepository-&gt;findAllForCaseInstruction( $options['caseInstructionId'] )
              )
  )
  </code></pre>
  
  <p>I'm not sure how much code I can post as it is for client work. The query I use is properly populating the dropdown box like it would without the query, and even if I select all of the entity without any <code>WHERE</code> clauses, the same problem occurs.</p>
  
  <p>Thanks for any and all help.</p>