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

Appearance settings

[Validator] Fix bad handling of nulls when the 'fields' option of the Unique constraint is set #48933

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
Jan 11, 2023

Conversation

plfort
Copy link
Contributor

@plfort plfort commented Jan 9, 2023

Q A
Branch? 6.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

UniqueValidator results differ when using Unique constraint fields options and null values:

Example:

$validator->validate([null,null], new Unique()); // Violation, OK

$validator->validate([['foo' => null], ['foo' => null]], new Unique(fields: ['foo']); // No violation, KO

@carsonbot carsonbot added this to the 6.1 milestone Jan 9, 2023
@plfort plfort force-pushed the bug_uniquevalidator_null_field branch from bfdbb38 to 7b09715 Compare January 9, 2023 21:18
@plfort plfort force-pushed the bug_uniquevalidator_null_field branch from 7b09715 to 56596c8 Compare January 9, 2023 21:19
@carsonbot
Copy link

Hey!

I think @WojciechKania3 has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas modified the milestones: 6.1, 5.4 Jan 11, 2023
@fabpot
Copy link
Member

fabpot commented Jan 11, 2023

Thank you @plfort.

@fabpot fabpot merged commit f3df429 into symfony:6.1 Jan 11, 2023
@plfort plfort deleted the bug_uniquevalidator_null_field branch January 11, 2023 12:37
This was referenced Jan 24, 2023
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.