symfony/symfony-docs — pull request #4014 by liutec (2014-07-09 21:06:23+00:00)
Title: Updated "query_builder" field option

| Q | A
| ------------- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets |

Validation fails because it attempts to match the given data with the identity field of the first entity referenced in the QueryBuilder and not the identity field of the referenced entity that matches the one specified through the 'class' field option.

Another problem may occur if the name of the identity field of the entity specified through the 'class' field option does not match the name of the identity field of the first entity referenced in the QueryBuilder.

Currently there is no warning to indicate this behavior that affects all form types extending the entity type and also, from what I've seen by examining the code for the validation, there is no simple fix to add such warning or fix this problem.