Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[DoctrineBridge] FixUniqueEntity for non-integer identifiers#59126

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

GiuseppeArcuti
Copy link
Contributor

QA
Branch?7.2
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#58883
LicenseMIT

Failed to reproduce the issue reported in#58883

@carsonbot

This comment was marked as resolved.

@OskarStarkOskarStark changed the title[DoctrineBridge] Fix UniqueEntity for non-integer identifiers[DoctrineBridge] FixUniqueEntity for non-integer identifiersDec 7, 2024
@nicolas-grekas
Copy link
Member

@GiuseppeArcuti can you, now that there is a reproducer on the issue?

@nicolas-grekas
Copy link
Member

What should be done next here? Anyone up to help finish this PR?

@norkunas
Copy link
Contributor

norkunas commentedMar 12, 2025
edited
Loading

What should be done next here? Anyone up to help finish this PR?

Either it should support symfony uid properly, or add an extension point to add custom equality checkers or some sort of callback option?

@wkania
Copy link
Contributor

No one tagged me.
@GiuseppeArcuti , thanks for creating the test.
There is, of course, an issue - I mistakenly assumed that the identifiers were scalars.
If you're still working on this bug, replaceline 200 in the UniqueEntityValidator class with the code below:

                if ($fieldValues[$identifierFieldName] instanceof \Stringable) {                    $fieldValues[$identifierFieldName] = (string) $fieldValues[$identifierFieldName];                }                if ($propertyValue instanceof \Stringable) {                    $propertyValue = (string) $propertyValue;                }                if ($fieldValues[$identifierFieldName] !== $propertyValue) {

This should resolve the issue in most cases.
There’s still a separate problem with object-type identifiers that may not have atoString method. However, that’s part of a different feature (another PR) that will introduce something like anormalizer.
I’ll take care of that in a new PR.

Anyone up to help finish this PR?

@nicolas-grekas If the PR has been abandoned, what’s the procedure in that case?

@OskarStark
Copy link
Contributor

You can just open a new PR and reference this one and the issue, thanks

wkania reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

Continued in#60275, thanks for the PR@GiuseppeArcuti

fabpot added a commit that referenced this pull requestMay 10, 2025
…tifiers (GiuseppeArcuti, wkania)This PR was merged into the 7.2 branch.Discussion----------[DoctrineBridge] Fix UniqueEntityValidator Stringable identifiers| Q             | A| ------------- | ---| Branch?       | 7.2| Bug fix?     | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#58883| License       | MIT`@GiuseppeArcuti` , thanks for creating the test in [PR](#59126).More info in the [comment](#59126 (comment)).Commits-------b0f012f [DoctrineBridge] Fix UniqueEntityValidator Stringable identifiers572ebe8 [DoctrineBridge] Fix UniqueEntity for non-integer identifiers
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.2
Development

Successfully merging this pull request may close these issues.

6 participants
@GiuseppeArcuti@carsonbot@nicolas-grekas@norkunas@wkania@OskarStark

[8]ページ先頭

©2009-2025 Movatter.jp