Skip to content
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

fix: add UniqueEntity constraint to username field. #1567

Conversation

m-ar-c
Copy link
Contributor

@m-ar-c m-ar-c commented Sep 2, 2022

Subject

This PR add UniqueEntity constraint to username field in validation.xml.

Why :
The username property is defined as unique in the DB ( in BaseUser.orm.xml ) so we need to
constraint the field to unique in the form in order to prevent a
UniqueConstraintViolationException exception.

I am targeting this branch, because it is BC.

Changelog

### Fixed
- Add UniqueEntity constraint to username field in order to prevent UniqueConstraintViolationException exception.

The username property is defined as unique in the DB (in
Resources/config/doctrine/BaseUser.orm.xml), so we need to constraint
the field to unique in the form in order to prevent a
UniqueConstraintViolationException exception.
@VincentLanglet VincentLanglet requested review from jordisala1991 and a team September 22, 2022 11:18
@VincentLanglet VincentLanglet merged commit 5449239 into sonata-project:5.x Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants