UUID Relation cannot be built corerctly in some cases #7435

Open
opened 2026-01-22 15:51:39 +01:00 by admin · 0 comments
Owner

Originally created by @bytes-commerce on GitHub (Nov 6, 2024).

Bug Report

Q A
Version 2.17.2

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:
grafik

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

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

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

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):
grafik

Here are information for the specific elements in the DB:

UUID Works
0192f361-bfac-7e90-80e0-382f9f6edfab 🚫
0192ef68-73da-7497-a446-bf3a300d0a41 ✔️
0192f26c-da9f-7ebd-8538-28d8e3163b1e ✔️
0192f26d-2e06-7560-8a83-ce406955add6 ✔️

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.

Originally created by @bytes-commerce on GitHub (Nov 6, 2024). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |-------------------------------------------- | ------ | Version | 2.17.2 #### 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: ![grafik](https://github.com/user-attachments/assets/9b477468-045b-4631-83f2-e902aa38051e) Here you can see that its unable to report the properties values correctly: ![grafik](https://github.com/user-attachments/assets/3af31fce-602d-4186-914e-5fb625fe62f0) Here you can see that the ID is query-able via MySQL Workbench: ![grafik](https://github.com/user-attachments/assets/7be627c4-388d-4bc5-9760-c1a46e84bd25) Now comes the interesting part, it seems that for example EasyAdmin is loading it differently and thus, finding the data values correctly: ![grafik](https://github.com/user-attachments/assets/32977815-d159-400a-ba3e-573af32239cd) 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): ![grafik](https://github.com/user-attachments/assets/2c9253c7-77c4-4337-a411-a267f0f6bfe4) Here are information for the specific elements in the DB: | UUID | Works | |-------------------------------------------- | ------ | 0192f361-bfac-7e90-80e0-382f9f6edfab | :no_entry_sign: | | 0192ef68-73da-7497-a446-bf3a300d0a41 | :heavy_check_mark: | | 0192f26c-da9f-7ebd-8538-28d8e3163b1e | :heavy_check_mark: | | 0192f26d-2e06-7560-8a83-ce406955add6 | :heavy_check_mark: | 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7435