Fixes error on complex where statements
Fixes #205
Hello @Stumpftopf ,
Thank you for your contribution, do you mind to write a test covering this fix ?
Any chance to get that merged in time? I have the same problem.
We can't merge it without tests
@garak Thanks for the clearification. I‘ll fork the repo temporarly.
This fix is also missing the case that $node->conditionalExpression can be another ConditionalPrimary.
An example where this happens is for
$expr->orX(
$expr->between('event_date.dateFrom', ':start', ':end'),
$expr->between('event_date.dateTo', ':start', ':end')
)
that since https://github.com/doctrine/orm/commit/550fcbc17fc9d927edf34bd0e5f9efc3b68ce344#diff-77ad6f787b65be81710fe85fee3d41f4b8e0b766446f8f24c28e0440b7eea17eR61 results in ((event_date.dateFrom BETWEEN :start AND :end) OR (event_date.dateTo BETWEEN :start AND :end)).
Also true for other instances of unnecessary parenthesis (which are still valid DQL, though).
I get a bug when i use the default search with a simple query together with andWhere
$qb = $em->createQueryBuilder()
->select('u')
->from('App:Participant','u')
->where('u.registration=:registration')->setParameter('registration',$registration->getId())
->andWhere('(u.isWaiting=0 or u.isWaiting is null)')
;
This patch works like a charm! Please merge!!
This patch works like a charm! Please merge!!
As soon as we have some automatic tests to confirm that it works, I'll be glad to merge.