Skip to content

Commit 4926eb1

Browse files
authored
Merge pull request #270 from rossriley/hotfix/prevent-duplicate-attributes
Exclude handled attributes from the general list in form_start
2 parents babba49 + 24a636f commit 4926eb1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/form/_form_theme.twig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,12 @@ templates:
323323
{%- else -%}
324324
{% set form_method = "POST" %}
325325
{%- endif -%}
326-
<form name="{{ name }}" method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
326+
<form name="{{ name }}"
327+
method="{{ form_method|lower }}"
328+
{% if action != '' %} action="{{ action }}"{% endif %}
329+
{% for attrname, attrvalue in attr if attrname not in ['name', 'method', 'enctype'] %} {{ attrname }}="{{ attrvalue }}"{% endfor %}
330+
{% if multipart %} enctype="multipart/form-data"{% endif %}
331+
>
327332
{%- if form_method != method -%}
328333
<input type="hidden" name="_method" value="{{ method }}" />
329334
{%- endif -%}

0 commit comments

Comments
 (0)