Skip to content

Commit df4cc40

Browse files
committed
bug #17568 Improved Bootstrap form theme for hidden fields (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #17568). Discussion ---------- Improved Bootstrap form theme for hidden fields | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16925 | License | MIT | Doc PR | - Commits ------- ba5d7f9 Improved Bootstrap form theme for hidden fields
2 parents cc198df + ba5d7f9 commit df4cc40

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{# Widgets #}
44

55
{% block form_widget_simple -%}
6-
{% if type is not defined or 'file' != type %}
6+
{% if type is not defined or type not in ['file', 'hidden'] %}
77
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
88
{% endif %}
99
{{- parent() -}}

src/Symfony/Bridge/Twig/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require-dev": {
2323
"symfony/asset": "~2.7",
2424
"symfony/finder": "~2.3",
25-
"symfony/form": "~2.7,>=2.7.8",
25+
"symfony/form": "~2.7.10|~2.8.3",
2626
"symfony/http-kernel": "~2.3",
2727
"symfony/intl": "~2.3",
2828
"symfony/routing": "~2.2",

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public function testSingleChoiceExpanded()
684684
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
685685
]
686686
]
687-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
687+
/following-sibling::input[@type="hidden"][@id="name__token"]
688688
]
689689
'
690690
);
@@ -844,7 +844,7 @@ public function testSingleChoiceExpandedWithoutTranslation()
844844
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
845845
]
846846
]
847-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
847+
/following-sibling::input[@type="hidden"][@id="name__token"]
848848
]
849849
'
850850
);
@@ -883,7 +883,7 @@ public function testSingleChoiceExpandedAttributes()
883883
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]'.$classPart.'
884884
]
885885
]
886-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
886+
/following-sibling::input[@type="hidden"][@id="name__token"]
887887
]
888888
'
889889
);
@@ -930,7 +930,7 @@ public function testSingleChoiceExpandedWithPlaceholder()
930930
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
931931
]
932932
]
933-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
933+
/following-sibling::input[@type="hidden"][@id="name__token"]
934934
]
935935
'
936936
);
@@ -966,7 +966,7 @@ public function testSingleChoiceExpandedWithBooleanValue()
966966
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
967967
]
968968
]
969-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
969+
/following-sibling::input[@type="hidden"][@id="name__token"]
970970
]
971971
'
972972
);
@@ -1012,7 +1012,7 @@ public function testMultipleChoiceExpanded()
10121012
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
10131013
]
10141014
]
1015-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
1015+
/following-sibling::input[@type="hidden"][@id="name__token"]
10161016
]
10171017
'
10181018
);
@@ -1182,7 +1182,7 @@ public function testMultipleChoiceExpandedWithoutTranslation()
11821182
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
11831183
]
11841184
]
1185-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
1185+
/following-sibling::input[@type="hidden"][@id="name__token"]
11861186
]
11871187
'
11881188
);
@@ -1231,7 +1231,7 @@ public function testMultipleChoiceExpandedAttributes()
12311231
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
12321232
]
12331233
]
1234-
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
1234+
/following-sibling::input[@type="hidden"][@id="name__token"]
12351235
]
12361236
'
12371237
);
@@ -1733,7 +1733,7 @@ public function testHidden()
17331733
'/input
17341734
[@type="hidden"]
17351735
[@name="name"]
1736-
[@class="my&class form-control"]
1736+
[@class="my&class"]
17371737
[@value="foo&bar"]
17381738
'
17391739
);

0 commit comments

Comments
 (0)