Uh oh!
There was an error while loading. Please reload this page.
fix(ulid): convert Ulid object to binary for ORM search filter - #4313
fix(ulid): convert Ulid object to binary for ORM search filter#4313misaert wants to merge 1 commit into
Conversation
alanpoulain
commented
Jun 9, 2021
Hello, |
misaert
commented
Jun 9, 2021
Hello, Thanks for the quick answer. I understand. I hope a generic solution will be found in the future. For now, I am following your recommandation with my own search filter on my project. |
soyuka
commented
Jun 10, 2021
Closing, we'll attempt something to fix this properly but it'll probably invoke using a new filter or a complete rewrite of the SearchFilter. |
When I want filter a resource by a relation property defined by an Ulid identifier, it doesn't work. This PR adds the conversion to binary before calling the query builder of Doctrine (as explained on the Symfony documentation: https://symfony.com/doc/current/components/uid.html#storing-ulids-in-databases).
Example:
Currently, the result is 0 because the query builder uses the string representation that does not correspond to the binary stored in the database.
It is my first contribution. I don't know if I have to add a test for it and how, and I don't know if I have to change the Changelog file right now.
Don't hesitate to help me to improve this PR 🙂