Skip to content

[Form] collect all transformation failures #37345

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
Jun 20, 2020
Merged

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 18, 2020

Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #37262
License MIT
Doc PR

@xabbuh xabbuh added this to the 3.4 milestone Jun 18, 2020
@xabbuh xabbuh force-pushed the issue-37262 branch 3 times, most recently from b82ff49 to a18a78d Compare June 18, 2020 20:15
Comment on lines 351 to 354
$this->assertCount(2, $form->getErrors());
$this->assertSame('This value is not valid.', $form->getErrors()[0]->getMessage());
$this->assertSame('This value is not valid.', $form->getErrors()[1]->getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why this error is added twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Once for the month and once for the year

Copy link
Member Author

Choose a reason for hiding this comment

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

The removed continue is responsible for it. Maybe we should keep it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hah, true. I didn't notice the invalid month. Was focused on the year only due to my initial test. 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Should the cause of the error be tested as well then? To ensure one is really caused by the month and one by the year.

Copy link
Contributor

Choose a reason for hiding this comment

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

3.4.40 also adds two errors in this case so it should be fine to keep that behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should the cause of the error be tested as well then? To ensure one is really caused by the month and one by the year.

Yes, totally makes sense. I did that.

@xabbuh xabbuh force-pushed the issue-37262 branch 4 times, most recently from 016b3d5 to 519ab16 Compare June 19, 2020 06:23
@fabpot
Copy link
Member

fabpot commented Jun 20, 2020

Thank you @xabbuh.

@fabpot fabpot merged commit cc145e2 into symfony:3.4 Jun 20, 2020
@xabbuh xabbuh deleted the issue-37262 branch June 20, 2020 07:28
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.

4 participants