metaclass-nl / filter-bundle

Filter bundle for API Platform, Filter Logic
MIT License
50 stars 9 forks source link

Support for DBAL version ^3 #19

Closed MarkDaleman closed 2 months ago

MarkDaleman commented 2 months ago

Since there's support for Symfony 7, will there be support for DBAL ^3?

metaclass-nl commented 2 months ago

Ther is no dependency on DBAL in composer.json. Howerver, there is one on "doctrine/orm": "^2.7" , i assume it does not allow DBAL ^3. But doctrine/orm 3.2 is available, and it requires "doctrine/dbal": "^3.8.2 || ^4",

So the filter-bundle needs to be tested with: "doctrine/orm": "^3.0".

metaclass-nl commented 2 months ago

With doctrine/orm 3.2.0 the following errors occur:

TypeError: Doctrine\ORM\QueryBuilder::add(): Argument #2 ($dqlPart) must be of type object|array|string, null given, called in /var/www/html/bundles/filter-bundle/src/Filter/DateFilter.php on line 55

TypeError: Doctrine\ORM\QueryBuilder::add(): Argument #2 ($dqlPart) must be of type object|array|string, null given, called in /var/www/html/bundles/filter-bundle/src/Filter/FilterLogic.php on line 145

Obviously caused by passing null to $queryBuilder->add. Need to figure out what the old version did if null was passed and how to get the same result with the new verson.

I have little time right now so this may take a while (up to a month).

MarkDaleman commented 2 months ago

Hello @metaclass-nl,

My colleague found the following:

afbeelding

If the $oldWhere is null, you could reset the DQL part.

This seems to work!

metaclass-nl commented 2 months ago

Thanks a lot! With this all tests run with doctrine/orm 3.2.0.

Published release v3.2.0