Skip to content

Commit 0af026e

Browse files
Merge branch '3.4' into 4.0
* 3.4: (22 commits) [DI] Add tests for EnvVarProcessor [Bridge\PhpUnit] Fix #26430 Cannot autoload listeners Make sure we always render errors. Eventhough labels are disabled Make sure form errors is valid HTML [HttpKernel] Allow generators in registerBundle [TwigBundle] document TwigRenderer BC break in UPGRADE-3.4 Extra line to bootstrap 3 horizontal layout [Serializer] Remove const override Update Client.php [PhpUnitBridge] Ability to use different composer.json file [DomCrawler] FormField: remove an useless return statement [Config] ReflectionClassResource check abstract ServiceSubscriberInterface and EventSubscriberInterface Display the Welcome Page when there is no homepage defined fix regression when extending the Container class without a constructor fix the updating of timestamp in the MemcachedSessionHandler [SecurityBundle] Make extra character non mandatory in regex [Config] Add characters to the regex bumped Symfony version to 3.4.7 updated VERSION for 3.4.6 updated CHANGELOG for 3.4.6 ...
2 parents 575004a + 0543aa6 commit 0af026e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Resources/views/Form/bootstrap_3_horizontal_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ col-sm-10
6262
{{- form_errors(form) -}}
6363
</div>{#--#}
6464
</div>
65-
{%- endblock checkbox_row %}
65+
{%- endblock checkbox_row %}

Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,13 @@
203203
{% set label = name|humanize %}
204204
{%- endif -%}
205205
{%- endif -%}
206-
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}}</{{ element|default('label') }}>
206+
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}</{{ element|default('label') }}>
207+
{%- else -%}
208+
{%- if errors|length > 0 -%}
209+
<div id="{{ id }}_errors" class="mb-2">
210+
{{- form_errors(form) -}}
211+
</div>
212+
{%- endif -%}
207213
{%- endif -%}
208214
{%- endblock form_label %}
209215

@@ -261,12 +267,12 @@
261267

262268
{% block form_errors -%}
263269
{%- if errors|length > 0 -%}
264-
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
265-
<ul class="list-unstyled mb-0">
266-
{%- for error in errors -%}
267-
<li><span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span></li>
268-
{%- endfor -%}
269-
</ul>
270-
</div>
270+
<span class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
271+
{%- for error in errors -%}
272+
<span class="mb-0 d-block">
273+
<span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span>
274+
</span>
275+
{%- endfor -%}
276+
</span>
271277
{%- endif %}
272278
{%- endblock form_errors %}

0 commit comments

Comments
 (0)