Skip to content
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

[Form] do not validate non-submitted form fields in PATCH requests #30265

Merged
merged 1 commit into from Feb 21, 2019

Conversation

Projects
None yet
5 participants
@xabbuh
Copy link
Member

xabbuh commented Feb 15, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11493, #19788, #20805, #24453, #30011
License MIT
Doc PR

When a form field is not embedded as part of a HTTP PATCH requests, its
validation constraints configured through the constraints option must
not be evaluated. The fix from #10567 achieved this by not mapping their
violations to the underlying form field. This however also means that
constraint violations caused by validating the whole underlying data
object will never cause the form to be invalid. This breaks use cases
where some constraints may, for example, depend on the value of other
properties that were changed by the submitted data.

@HeahDude
Copy link
Member

HeahDude left a comment

LGTM, this is so nice to approve such a PR :). Thank you so much!

@nicolas-grekas
Copy link
Member

nicolas-grekas left a comment

uninformed vote, but still happy and confident you solved that many (old) issues :)

@xabbuh xabbuh force-pushed the xabbuh:issue-24453 branch from bda4eb5 to a60d802 Feb 21, 2019

@xabbuh xabbuh merged commit a60d802 into symfony:3.4 Feb 21, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

xabbuh added a commit that referenced this pull request Feb 21, 2019

bug #30265 [Form] do not validate non-submitted form fields in PATCH …
…requests (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] do not validate non-submitted form fields in PATCH requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11493, #19788, #20805, #24453, #30011
| License       | MIT
| Doc PR        |

When a form field is not embedded as part of a HTTP PATCH requests, its
validation constraints configured through the `constraints` option must
not be evaluated. The fix from #10567 achieved this by not mapping their
violations to the underlying form field. This however also means that
constraint violations caused by validating the whole underlying data
object will never cause the form to be invalid. This breaks use cases
where some constraints may, for example, depend on the value of other
properties that were changed by the submitted data.

Commits
-------

a60d802 do not validate non-submitted form fields in PATCH requests

@xabbuh xabbuh deleted the xabbuh:issue-24453 branch Feb 21, 2019

@ogizanagi

This comment has been minimized.

Copy link
Member

ogizanagi commented Feb 28, 2019

Confirming this is solving the issue, as I've just hit it and tried this patch 😉
Thanks for fixing it :)

@xabbuh

This comment has been minimized.

Copy link
Member Author

xabbuh commented Feb 28, 2019

Thanks for the confirmation @ogizanagi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.