Closed
Description
Symfony version(s) affected: 4.1
Description
It occurs in this commit
By putting errors in the label now the following issue occurs. And we can not use Customize Form Rendering
For example when I am putting a field like this:
{{ form_label(attraction.surroundings) }}
{{ form_widget(attraction.surroundings) }}
{{ form_help(attraction.surroundings) }}
{{ form_errors(attraction.surroundings) }}
And Error occured then The error message is one time showing in label and 2nd time what i put form_errors.
Possible Solution
So we should take errors out from the label and have to put form_errors in form_row And we have to put form_errors in the end otherwise if the error occurs then error area will push the whole layout down.
{% block form_row -%}
{%- if compound is defined and compound -%}
{%- set element = 'fieldset' -%}
{%- endif -%}
{%- set widget_attr = {} -%}
{%- if help is not empty -%}
{%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%}
{%- endif -%}
<{{ element|default('div') }} class="form-group">
{{- form_label(form) -}}
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
**{{- form_errors(form) -}}**
</{{ element|default('div') }}>
{%- endblock form_row %}