Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5f48c6a

Browse filesBrowse files
committed
[Form] Fix BC break introduced in symfony#14403
1 parent a884313 commit 5f48c6a
Copy full SHA for 5f48c6a

File tree

5 files changed

+8
-5
lines changed
Filter options

5 files changed

+8
-5
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,10 @@
319319

320320
{%- block widget_attributes -%}
321321
id="{{ id }}" name="{{ full_name }}"
322+
{%- if read_only %} readonly="readonly"{% endif -%}
322323
{%- if disabled %} disabled="disabled"{% endif -%}
323324
{%- if required %} required="required"{% endif -%}
324-
{%- for attrname, attrvalue in attr -%}
325+
{%- for attrname, attrvalue in attr if 'readonly' != attrname -%}
325326
{{- " " -}}
326327
{%- if attrname in ['placeholder', 'title'] -%}
327328
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
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 ?>
23
<?php if ($required): ?> required="required"<?php endif ?>
34
<?php foreach ($attr as $k => $v): ?>
5+
<?php if ('readonly' === $k) { continue; } ?>
46
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
57
<?php printf(' %s="%s"', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
68
<?php elseif ($v === true): ?>

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
4444
"symfony/polyfill-intl-icu": "~1.0",
4545
"symfony/security": "~2.6|~3.0.0",
46-
"symfony/form": "~2.8",
46+
"symfony/form": "^2.8.4",
4747
"symfony/expression-language": "~2.6|~3.0.0",
4848
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
4949
"symfony/validator": "~2.5|~3.0.0",

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,7 @@ public function testWidgetAttributes()
24302430
$html = $this->renderWidget($form->createView());
24312431

24322432
// compare plain HTML to check the whitespace
2433-
$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);
2433+
$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);
24342434
}
24352435

24362436
public function testWidgetAttributeNameRepeatedIfTrue()

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2373,7 +2373,7 @@ public function testWidgetAttributes()
23732373
$html = $this->renderWidget($form->createView());
23742374

23752375
// compare plain HTML to check the whitespace
2376-
$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);
2376+
$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);
23772377
}
23782378

23792379
public function testWidgetAttributeNameRepeatedIfTrue()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.