symfony/symfony — pull request #11692 by xabbuh (2014-08-18 12:13:30+00:00)
Title: [DomCrawler] check for the correct field type

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11689
| License | MIT
| Doc PR |

HTML allow to define different form fields with the same name. Imagine the following form:

```html

klickme

```

Since the `FormFieldRegistry` can only handle one field per name, the hidden field option is registered first before the radio field with the same name is evaluated. Thus, the `FormFieldRegistry` returns an `InputFormField` instance on which the `addChoices()` method can not be called.