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

[Validator] Fixed the @Valid(groups={"group"}) against null exception case #25297

Merged
merged 1 commit into from Dec 4, 2017

Conversation

Projects
None yet
5 participants
@vudaltsov
Contributor

vudaltsov commented Dec 3, 2017

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

When @Valid(groups={"group"}) has non-empty groups and the value is null, validator throws Cannot validate values of type "NULL" automatically. Please provide a constraint. at RecursiveContextualValidator:164.

I don't really understand, why everything is okay for @Valid() without groups, but hope that my fix is correct anyway.

@xabbuh

xabbuh approved these changes Dec 4, 2017

good catch

@xabbuh xabbuh added this to the 3.4 milestone Dec 4, 2017

@nicolas-grekas

This comment has been minimized.

Show comment
Hide comment
@nicolas-grekas
Member

nicolas-grekas commented Dec 4, 2017

Thank you @vudaltsov.

@nicolas-grekas nicolas-grekas merged commit 56f24d0 into symfony:3.4 Dec 4, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Dec 4, 2017

bug #25297 [Validator] Fixed the @Valid(groups={"group"}) against nul…
…l exception case (vudaltsov)

This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fixed the @Valid(groups={"group"}) against null exception case

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

When `@Valid(groups={"group"})` has non-empty groups and the value is `null`, validator throws `Cannot validate values of type "NULL" automatically. Please provide a constraint.` at `RecursiveContextualValidator:164`.

I don't really understand, why everything is okay for `@Valid()` without groups, but hope that my fix is correct anyway.

Commits
-------

56f24d0 Fixed the null value exception case.

@vudaltsov vudaltsov deleted the vudaltsov:valid-null branch Dec 4, 2017

This was referenced Dec 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment