Skip to content

[Form][Validator] Add new unique entity validation on form type #18468

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 30, 2023

Conversation

94noni
Copy link
Contributor

@94noni 94noni commented Jun 29, 2023

Hello,

Where we have entity without validation on it, and want validation on the form type, this can be valuable I think

NoteI did not found such info on the doc so after slack discuss, I got the answer and thus proposed this doc

@94noni 94noni requested a review from xabbuh as a code owner June 29, 2023 17:52
@carsonbot carsonbot changed the title Add new unique entity validation on form type [Form][Validator] Add new unique entity validation on form type Jun 30, 2023
@javiereguiluz javiereguiluz added this to the 5.4 milestone Jun 30, 2023
@javiereguiluz javiereguiluz changed the base branch from 6.3 to 5.4 June 30, 2023 07:34
@javiereguiluz javiereguiluz merged commit cb7247a into symfony:5.4 Jun 30, 2023
@javiereguiluz
Copy link
Member

Thanks for improving this code example. We merged it in 5.4 and up.

@94noni 94noni deleted the patch-10 branch June 30, 2023 07:42
@94noni
Copy link
Contributor Author

94noni commented Jun 30, 2023

@javiereguiluz thx! but watch out that I use a php8 feature

@xabbuh
Copy link
Member

xabbuh commented Jul 21, 2023

I am not completely convinced of this change. Without any comment this may now look like you will have to add the UniqueEntity constraint to the entity and the form.

@94noni
Copy link
Contributor Author

94noni commented Jul 21, 2023

@xabbuh thx for commenting, I would be glad to PR adding a comment but I am unsure of what kind of comment you have in mind, may I ask you more details?

like, the one in the PR desc for example?

@xabbuh
Copy link
Member

xabbuh commented Jul 24, 2024

@94noni Sorry for being late with my response, but can you explain why it was necessary to add the constraint option to the form at all in your case and why the example as it was before did not work?

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