Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
colinodell wants to merge1 commit intosymfony:masterfromcolinodell:form-clear-errors
Closed

[Form] Added ability to clear form errors#14233

colinodell wants to merge1 commit intosymfony:masterfromcolinodell:form-clear-errors

Conversation

@colinodell
Copy link
Contributor

QA
Bug fix?no
New feature?yes
BC breaks?yes
Deprecations?no
Tests pass?yes
Fixed tickets#14060
LicenseMIT
Doc PRsymfony/symfony-docs#5152

* Travis seems to be failing some builds for an unrelated reason

TODO:

  • Ensure Travis tests pass
  • Add/update relevant documentation

Summary:

This PR adds the ability to manually clear form errors, thus improving the DX issue reported in#14060.

TerjeBr and chrissnyder2337 reacted with thumbs up emoji
@dosten
Copy link
Contributor

I think this can be added to 2.7 without problems.

@colinodell
Copy link
ContributorAuthor

@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.

@colinodell
Copy link
ContributorAuthor

Travis seems to be failing some builds but I think my unit tests are passing.

@dosten
Copy link
Contributor

@colinodell Following the BC promise (http://symfony.com/doc/current/contributing/code/bc.html#changing-interfaces) and as of theFormInterface isn't tagged as@api you can add theclearErrors method without problems.

@wouterj
Copy link
Member

@dosten: with some problems, check footnote 2:

Should be avoided. When done, this change must be documented in the UPGRADE file.

@colinodell
Copy link
ContributorAuthor

The required tests now pass after rebasing onto the latestmaster.

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 checkmethod_exists on each child which seems too dirty.)

@stof
Copy link
Member

stof commentedApr 7, 2015

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

TerjeBr reacted with thumbs down emoji

@xabbuhxabbuh added the Form labelApr 21, 2015
@webmozartwebmozart changed the title[DX] [Form] Added ability to clear form errors[Form] Added ability to clear form errorsJun 19, 2015
@webmozart
Copy link
Contributor

Closing since the original ticket was closed as well:#14060

@mcorteel
Copy link
Contributor

It was reopened by@fabpot a few days ago though!

@TerjeBr
Copy link

TerjeBr commentedJun 7, 2018
edited
Loading

@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.

@xabbuh
Copy link
Member

FYI, we cannot reopen the PR as the repository this was based on has been deleted in the meantime.

fabpot added a commit that referenced this pull requestJun 25, 2018
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#9916This 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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@colinodell@dosten@wouterj@stof@webmozart@mcorteel@TerjeBr@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp