Pārlūkot izejas kodu

[Form] FormType labels should never have a for attribute

Victor Berchet 14 gadi atpakaļ
vecāks
revīzija
60c463d184

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/collection_label.html.php → src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php


+ 2 - 2
src/Symfony/Bundle/TwigBundle/Resources/views/Form/div_layout.html.twig

@@ -10,11 +10,11 @@
 {% endspaceless %}
 {% endblock field_label %}
 
-{% block collection_label %}
+{% block form_label %}
 {% spaceless %}
     <label {% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}</label>
 {% endspaceless %}
-{% endblock collection_label %}
+{% endblock form_label %}
 
 {% block field_errors %}
 {% spaceless %}

+ 2 - 2
tests/Symfony/Tests/Component/Form/AbstractDivLayoutTest.php

@@ -147,7 +147,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
 '/input[@type="hidden"][@id="parent__token"]
 /following-sibling::div
     [
-        ./label[@for="parent_child1"]
+        ./label[not(@for)]
         /following-sibling::div[@id="parent_child1"]
             [
                 ./div
@@ -160,7 +160,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
 
 /following-sibling::div
     [
-        ./label[@for="parent_child2"]
+        ./label[not(@for)]
         /following-sibling::div[@id="parent_child2"]
             [
                 ./div