Skip to content

Commit c5af46d

Browse files
Merge branch '4.1'
* 4.1: [TwigBridge] fix lowest version of symfony/form Think positive KernelInterface can return null container [DI] Detect circular references with ChildDefinition parent [VarDumper] Fix global dump function return value for PHP7 [Ldap] Use shut up operator on connection errors at ldap_start_tls Implement startTest rather than startTestSuite [OptionsResolver] remove dead code and useless else [HttpFoundation] don't override StreamedResponse::setNotModified() Added relevent links for parsing to the phpdoc Add stricter checking for valid date time string Fix symfony/console (optional) dependency for MonologBridge fix not displaying labels when value is false [Form] Fix DateTimeType html5 input format
2 parents b33821d + 4a8426a commit c5af46d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Resources/views/Form/bootstrap_base_layout.html.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@
6464
{%- if datetime is not defined or not datetime -%}
6565
<div {{ block('widget_container_attributes') -}}>
6666
{%- endif %}
67+
{%- if label is not same as(false) -%}
6768
<div class="sr-only">
6869
{{ form_label(form.year) }}
6970
{{ form_label(form.month) }}
7071
{{ form_label(form.day) }}
7172
</div>
73+
{%- endif -%}
7274

7375
{{- date_pattern|replace({
7476
'{{ year }}': form_widget(form.year),
@@ -89,10 +91,10 @@
8991
{%- if datetime is not defined or false == datetime -%}
9092
<div {{ block('widget_container_attributes') -}}>
9193
{%- endif -%}
92-
<div class="sr-only">{{ form_label(form.hour) }}</div>
94+
{%- if label is not same as(false) -%}<div class="sr-only">{{ form_label(form.hour) }}</div>{%- endif -%}
9395
{{- form_widget(form.hour) -}}
94-
{%- if with_minutes -%}:<div class="sr-only">{{ form_label(form.minute) }}</div>{{ form_widget(form.minute) }}{%- endif -%}
95-
{%- if with_seconds -%}:<div class="sr-only">{{ form_label(form.second) }}</div>{{ form_widget(form.second) }}{%- endif -%}
96+
{%- if with_minutes -%}:{%- if label is not same as(false) -%}<div class="sr-only">{{ form_label(form.minute) }}</div>{%- endif -%}{{ form_widget(form.minute) }}{%- endif -%}
97+
{%- if with_seconds -%}:{%- if label is not same as(false) -%}<div class="sr-only">{{ form_label(form.second) }}</div>{%- endif -%}{{ form_widget(form.second) }}{%- endif -%}
9698
{%- if datetime is not defined or false == datetime -%}
9799
</div>
98100
{%- endif -%}

Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ public function testDateTimeWithWidgetSingleText()
15771577
[@type="datetime-local"]
15781578
[@name="name"]
15791579
[@class="my&class form-control"]
1580-
[@value="2011-02-03T04:05:06Z"]
1580+
[@value="2011-02-03T04:05:06"]
15811581
'
15821582
);
15831583
}
@@ -1598,7 +1598,7 @@ public function testDateTimeWithWidgetSingleTextIgnoreDateAndTimeWidgets()
15981598
[@type="datetime-local"]
15991599
[@name="name"]
16001600
[@class="my&class form-control"]
1601-
[@value="2011-02-03T04:05:06Z"]
1601+
[@value="2011-02-03T04:05:06"]
16021602
'
16031603
);
16041604
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/asset": "~3.4|~4.0",
2424
"symfony/dependency-injection": "~3.4|~4.0",
2525
"symfony/finder": "~3.4|~4.0",
26-
"symfony/form": "^4.1.2",
26+
"symfony/form": "^4.1.5",
2727
"symfony/http-foundation": "~3.4|~4.0",
2828
"symfony/http-kernel": "~3.4|~4.0",
2929
"symfony/polyfill-intl-icu": "~1.0",

0 commit comments

Comments
 (0)