Skip to content

Commit

Permalink
bug #2037 Fix form attribute collision in theme (hason)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.17.x-dev branch.

Discussion
----------

Fix form attribute collision in theme

This PR fixes name collision between the "children" attribute and a form field with the same name:
```php
$builder->add('children', ...);
```

See https://github.com/twigphp/Twig/blob/2.x/lib/Twig/Extension/Core.php#L1437-L1445

Commits
-------

039a98c Fix form attribute collision in theme
  • Loading branch information
javiereguiluz committed Feb 10, 2018
2 parents 39e9442 + 039a98c commit ec90e60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Resources/views/form/bootstrap_3_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
{% endif %}

<div class="row">
{% for field in form.children if 'hidden' not in field.vars.block_prefixes and field.vars.easyadmin.form_group == group_name %}
{% for field in form if 'hidden' not in field.vars.block_prefixes and field.vars.easyadmin.form_group == group_name %}
<div class="col-xs-12 {{ field.vars.easyadmin.field.css_class|default('') }}">
{{ form_row(field) }}
</div>
Expand All @@ -519,7 +519,7 @@
</div>
</div>
{% else %}
{% for field in form.children if 'hidden' not in field.vars.block_prefixes %}
{% for field in form if 'hidden' not in field.vars.block_prefixes %}
<div class="col-xs-12 {{ field.vars.easyadmin.field.css_class|default('') }}">
{{ form_row(field) }}
</div>
Expand Down

0 comments on commit ec90e60

Please sign in to comment.