I am having trouble on Symfony3 to display {{ form_errors([formname.field]) }} messages with a form embedding other forms.
I've dropped a symfony project on GitHub to explain my issue: https://github.com/nyluje/symfony_test_form_embedded
You'll find in it:
- \src\AppBundle\Controller\DefaultController.php modified to display the test.
- Under \src\AppBundle\Entity\ two entities: EntityForFormA and EntityForFromB created with a "field1" being of EmailType.
- Under \src\AppBundle\Form: 3 forms files; 2 Are directly related to the EntityForFormA and EntityForFormB: FormAType and FormBType, and the last one FormCType is there to embed both into one form.
At the top of the file \app\Resources\default\index.hmtl.twig:
{{ form_start(form_a) }}
{{ form_label(form_a.field1) }}
{{ form_widget(form_a.field1) }}
{{ form_errors(form_a.field1) }}
{{ form_end(form_a) }}
{{ form_start(form_c) }}
{{ form_label(form_c.FormA.field1) }}
{{ form_widget(form_c.FormA.field1) }}
{{ form_errors(form_c.FormA.field1) }}
{{ form_label(form_c.FormB.field1) }}
{{ form_widget(form_c.FormB.field1) }}
{{ form_errors(form_c.FormB.field1) }}
{{ form_end(form_c) }}
If you do a form A submit with value "j@j" you get:
The error message "This value is not a valid email address" is clearly displayed.
Now if you submit form C with value "j@j" in both fields:

The error message "This value is not a valid email address" is not displayed.
Does anyone know why the error messages don't display in case of FormC?