8000 Revert "bug #18275 [Form] Fix BC break introduced in #14403 (HeahDude)" · symfony/symfony@f4c9988 · GitHub
[go: up one dir, main page]

Skip to content

Commit f4c9988

Browse files
committed
Revert "bug #18275 [Form] Fix BC break introduced in #14403 (HeahDude)"
This reverts commit 56fa798, reversing changes made to dcc3fce.
1 parent 37a3a30 commit f4c9988

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,9 @@
315315

316316
{%- block widget_attributes -%}
317317
id="{{ id }}" name="{{ full_name }}"
318-
{%- if read_only %} readonly="readonly"{% endif -%}
319318
{%- if disabled %} disabled="disabled"{% endif -%}
320319
{%- if required %} required="required"{% endif -%}
321-
{%- for attrname, attrvalue in attr if 'readonly' != attrname -%}
320+
{%- for attrname, attrvalue in attr -%}
322321
{{- " " -}}
323322
{%- if attrname in ['placeholder', 'title'] -%}
324323
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($read_only): ?> readonly="readonly"<?php endif ?>
2-
<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
32
<?php if ($required): ?> required="required"<?php endif ?>
43
<?php foreach ($attr as $k => $v): ?>
5-
<?php if ('readonly' === $k) { continue; } ?>
64
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
75
<?php printf(' %s="%s"', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
86
<?php elseif ($v === true): ?>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,7 @@ public function testWidgetAttributes()
23692369
$html = $this->renderWidget($form->createView());
23702370

23712371
// compare plain HTML to check the whitespace
2372-
$this->assertSame('<input type="text" id="text" name="text" readonly="readonly" disabled="disabled" required="required" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value" />', $html);
2372+
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value" />', $html);
23732373
}
23742374

23752375
public function testWidgetAttributeNameRepeatedIfTrue()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ public function testWidgetAttributes()
22902290
$html = $this->renderWidget($form->createView());
22912291

22922292
// compare plain HTML to check the whitespace
2293-
$this->assertSame('<input type="text" id="text" name="text" readonly="readonly" disabled="disabled" required="required" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
2293+
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
22942294
}
22952295

22962296
public function testWidgetAttributeNameRepeatedIfTrue()

0 commit comments

Comments
 (0)
0