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] Add ability to clear form errors#27571

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
TerjeBr wants to merge2 commits intosymfony:masterfromTerjeBr:clear-form-errors
Closed

[Form] Add ability to clear form errors#27571

TerjeBr wants to merge2 commits intosymfony:masterfromTerjeBr:clear-form-errors

Conversation

@TerjeBr
Copy link

@TerjeBrTerjeBr commentedJun 10, 2018
edited
Loading

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

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

Update to latest symfony master
@colinodell
Copy link
Contributor

Thank you for re-creating and re-submitting my old commit! 👍

*
* @return FormInterface The form instance
*/
publicfunctionclearErrors($deep =false);
Copy link
Contributor

@linaorilinaoriJun 11, 2018
edited
Loading

Choose a reason for hiding this comment

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

I don't think this will be possible. You'll have to make this work for 4.x as well and as is, it's a BC break. Probably requires a new interface, which can be merged in this interface in 5.0.

Copy link
Author

@TerjeBrTerjeBrJun 11, 2018
edited
Loading

Choose a reason for hiding this comment

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

Do you mean I should create something likeFormClearErrorsInterface and makeForm implement that?

If we want to merge it intoFormInterface in 5.0, does that mean theFormClearErrorsInterface should be marked as deprecated right away, so that people will be aware that it goes away in version 5.0?

I have not done something like this before, so that is why I would apreciate some guideance in how to do it. Thanks.

Copy link
Author

Choose a reason for hiding this comment

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

Also@dosten wrote in#14233 (comment) that the BC break would not be a problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also@dosten wrote in#14233 (comment) that the BC break would not be a problem.

The BC promise states that adding a new method is not acceptablehttp://symfony.com/doc/current/contributing/code/bc.html#changing-interfaces

jvasseur reacted with thumbs up emoji
Copy link
Contributor

@jvasseurjvasseurJun 11, 2018
edited
Loading

Choose a reason for hiding this comment

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

@TerjeBr The comment you linked dates from 2015, since then the concept of@api interface was removed and we now consider every class as part of the public API (#15977,symfony/symfony-docs#5735). This means we can't add methods to any interface.

@TerjeBr
Copy link
Author

Please correct me if I am misstaken, but is theFormInterface something symfony users would implement?

Is this interfece not more kind of "internal" to the Symfony framework?

@pierredup
Copy link
Contributor

Only if an interface is marked as@internal, then it's not meant to be implemented (as is not part of the BC promise. Seehttp://symfony.com/doc/current/contributing/code/bc.html#using-our-interfaces for more information)

@nicolas-grekasnicolas-grekas added this to thenext milestoneJun 11, 2018
@TerjeBr
Copy link
Author

TerjeBr commentedJun 11, 2018
edited
Loading

I am trying to find a way forward here. Is it reasonable to want to markFormInterface as@internal? Or is that out of the question? Who else than Symfony maintainersimplements theFormInterface?

@TerjeBr
Copy link
Author

Or if I do as@iltar suggested, add a new interface, should that interface be created with the tag@deprecated if we aim to remove it again in version 5.0?

@javiereguiluz
Copy link
Member

Let's ping our Symfony Form expert@vudaltsov to see if he can spot any issue here (besides the interface issue mentioned by Iltar).

@vudaltsov
Copy link
Contributor

This PR can be closed in favor of#27580.

* deprecated the`ChoiceLoaderInterface` implementation in`CountryType`,`LanguageType`,`LocaleType` and`CurrencyType`
* added`input=datetime_immutable` to DateType, TimeType, DateTimeType
* added`rounding_mode` option to MoneyType
* added`FormInterface::clearErrors()` method
Copy link
Member

Choose a reason for hiding this comment

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

we cannot do this in a minor release as it is a BC break

*
* @return FormInterface The form instance
*/
publicfunctionclearErrors($deep =false);
Copy link
Member

Choose a reason for hiding this comment

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

This is a BC break that needs to be reverted.

/**
* {@inheritdoc}
*/
publicfunctionclearErrors($deep =false)
Copy link
Member

Choose a reason for hiding this comment

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

public function clearErrors(bool $deep = false): void

@xabbuh
Copy link
Member

Ah sorry, I missed#27580. So I am going to close here in favour of it. Thank you@TerjeBr for bootstrapping the work.

@xabbuhxabbuh closed thisJun 19, 2018
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
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh requested changes

+3 more reviewers

@pierreduppierreduppierredup left review comments

@jvasseurjvasseurjvasseur left review comments

@linaorilinaorilinaori requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

10 participants

@TerjeBr@colinodell@pierredup@javiereguiluz@vudaltsov@xabbuh@jvasseur@linaori@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp