-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Added ability to clear form errors #14233
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
Conversation
I think this can be added to 2.7 without problems. |
@dosten I was thinking it's a BC break because it adds a new method to an interface; any existing code implementing that interface would break unless they implemented this method. |
Travis seems to be failing some builds but I think my unit tests are passing. |
@colinodell Following the BC promise (http://symfony.com/doc/current/contributing/code/bc.html#changing-interfaces) and as of the |
@dosten: with some problems, check footnote 2:
|
The required tests now pass after rebasing onto the latest I'd prefer to keep this targeted for 3.0/master unless a core dev advises otherwise. (The BC-break could be avoiding by delaying the interface change until 3.0, but then you'd have to check |
I'm not a fan of adding this method in the FormInterface. It is here for a very specific use case, and this one can already be solved in different ways IMO: #14060 |
Closing since the original ticket was closed as well: #14060 |
It was reopened by @fabpot a few days ago though! |
@webmozart could you please reopen this? #14060 has been reopened, and it would be good to have this as an open PR to go with it. |
FYI, we cannot reopen the PR as the repository this was based on has been deleted in the meantime. |
This PR was squashed before being merged into the 4.2-dev branch (closes #27580). Discussion ---------- [Form] Add ability to clear form errors | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14060 | License | MIT | Doc PR | symfony/symfony-docs#9916 This PR adds the ability to manually clear form errors, thus improving the DX issue reported in #14060. Unlike my original approach in #14233 and #27571 which break BC, this adds a new `ClearableErrorInterface` which `Form` implements. (`Button` does not implement it because buttons can't have errors.) Commits ------- 9eb755c [Form] Add ability to clear form errors
* Travis seems to be failing some builds for an unrelated reason
TODO:
Summary:
This PR adds the ability to manually clear form errors, thus improving the DX issue reported in #14060.