-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Description
API Platform version(s) affected: 3.1.x
Description
Currently APIP assumes that Doctrine\ORM\Query\Expr`\Join::getCondition() returns a string and uses it as such in ApiPlatform\Doctrine\Orm\Extension\FilterEagerLoadingExtension (see here, it's used in preg_replace :
$condition = preg_replace($this->buildReplacePatterns($aliases), $replacements, $joinPart->getCondition() ?? ''); |
If you try using a Doctrine Expr instead, you unsurprinsingly get an error similar to
preg_replace(): Argument #3 ($subject) must be of type array|string, Doctrine\ORM\Query\Expr\Comparison give
How to reproduce
Have a custom filter that adds a join($stuff, $alias, Join::WITH, $queryBuilder->expr()->like('whatever', 'something')).
Use it in conjunction with a "normal" SearchFilter.
Possible Solution
Testing whether getCondition() returns an Expr and convert it into a string maybe? Doctrine should have a usable utility somewhere, but i haven't looked into it yet.
Metadata
Metadata
Assignees
Labels
No labels