Skip to content

[FrameworkBundle][TwigBridge] do not render empty form action attributes #16029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2015

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Sep 30, 2015

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #13852, #15995
License MIT
Doc PR

@fabpot
Copy link
Member

fabpot commented Sep 30, 2015

👍

@stof
Copy link
Member

stof commented Sep 30, 2015

this should be covered by a test to avoid regressions

@xabbuh
Copy link
Member Author

xabbuh commented Sep 30, 2015

tests added

@fabpot
Copy link
Member

fabpot commented Sep 30, 2015

Thank you @xabbuh.

@fabpot fabpot merged commit 1307043 into symfony:2.8 Sep 30, 2015
fabpot added a commit that referenced this pull request Sep 30, 2015
… action attributes (xabbuh)

This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle][TwigBridge] do not render empty form action attributes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13852, #15995
| License       | MIT
| Doc PR        |

Commits
-------

1307043 do not render empty form action attributes
@@ -274,7 +274,7 @@
{%- else -%}
{% set form_method = "POST" %}
{%- endif -%}
<form name="{{ name }}" method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
<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 %}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wil fail for action="0" again, which would be a valid relative path, I think we have checks like if action == '' for this reason in twig templates

@xabbuh xabbuh deleted the issue-13852 branch September 30, 2015 21:08
fabpot added a commit that referenced this pull request Oct 1, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

fix test for not configured form action attribute

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16029
| License       | MIT
| Doc PR        |

As @Tobion noted in #16029 (comment) `0` is a valid relative path that can be used for the form action.

Commits
-------

54c63fa fix test for not configured form action attribute
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants