Skip to content

[#361] fix: set parameter type in expression builder - #362

Open
brambaud wants to merge 1 commit into
Sylius:1.13from
brambaud:issues/361/set-parameter-type-in-expression-builder
Open

[#361] fix: set parameter type in expression builder#362
brambaud wants to merge 1 commit into
Sylius:1.13from
brambaud:issues/361/set-parameter-type-in-expression-builder

Conversation

@brambaud

@brambaud brambaud commented Feb 8, 2025

Copy link
Copy Markdown

See #361

I'm not sure how you would prefer to test this so I'm all ears 😁
Is it with the tests/Application?

When using SQLite with symfony/uid and symfony/doctrine-bridge, the column type of an uuid is BLOB (see https://github.com/symfony/symfony/blob/9ad4353a8cf349c3b431c163af0b1dd9a29c33a2/src/Symfony/Bridge/Doctrine/Types/AbstractUidType.php#L28).

Furthermore, the Sylius\Bundle\GridBundle\Doctrine\ORM\ExpressionBuilder used in the EntityFilter does not specify the type of the parameter, thus the inferred type is a string.

It implies that when filtering the query we'll compare the string representation of the uuid with its binary representation.

Therefore the EntityFilter does not work.

Closed Sylius#361
@brambaud
brambaud changed the base branch from 1.14 to 1.13 February 8, 2025 15:34
@loic425

loic425 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Thx a lot (yes, one year later, sorry).
I think it's still valid.

First, we need to convert an integer identifier into an Uuid one on a resource of the tests application.
And then using an EntityFilter there.

Second, there is already an ExpressionBuilderTest that you need to adapt.

@brambaud

Copy link
Copy Markdown
Author

Thanks for the reply! I will see how I can organize my time to add tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants