-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
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 |
b82ff49
to
a18a78d
Compare
$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()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. 😄
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
016b3d5
to
519ab16
Compare
Thank you @xabbuh. |