mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
UUID Relation cannot be built corerctly in some cases #7435
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bytes-commerce on GitHub (Nov 6, 2024).
Bug Report
Summary
In some cases it seems Doctrine is not able to correctly load entities that have a UUID foreign key set up.
Current behavior
I load an object that contains a relation to another object, with FK UUID. Upon inspection, I can verify that only 3 of 4 elements are loaded (by checking the content of the relation children). However, all UUIDs are correctly instanciated.
Here you can see that Doctrine is able to load the UUIDs correctly:

Here you can see that its unable to report the properties values correctly:

Here you can see that the ID is query-able via MySQL Workbench:

Now comes the interesting part, it seems that for example EasyAdmin is loading it differently and thus, finding the data values correctly:

Here you can see this very same UUID is not able to query the element when using

UNHEX(which is more likely to be used I'd assume):Here are information for the specific elements in the DB:
I cannot see much of a difference between these UUIDs.
Expected behavior
The collection contains 4 full elements that have all kind of data.
How to reproduce
I cannot really reproduce it; i just happen to see it in my local environment right now. This is the first time I see such an error and without changing my code, I cannot reproduce the issue again. So it must be connceted to the UUID, or the way how its being called.