Jira issue originally created by user deatheriam:
I have the next query:
$qb = $this->_em->createQueryBuilder();
->where('(Variant.isSellable = 0) OR (Variant IS NULL)')
that throws an exception:
PHP Fatal error: Call to undefined method Doctrine\ORM\Query\AST\ConditionalExpression::isSimpleConditionalExpression() .../Doctrine/ORM/Query/SqlWalker.php on line 1378.```
The SqlWalker::walkConditionalPrimary function expects the $primary parameter passed to it to be an instance of Doctrine\ORM\Query\AST\ConditionalPrimary, but it is actually an instance of Doctrine\ORM\Query\AST\ConditionalExpression class that is passed in that case and of course it does not have a method called isSimpleConditionalExpression.
The workaround is to use extra parentheses around the conditions: ((Variant.isSellable = 0) OR (Variant IS NULL)) which does not seem to be very intuitive way.
Comment created by @beberlei:
Fixed formatting, scheduled for 2.0.5
It works for me outside the QueryBuilder context when using DQL itself.
Can you call $qb->getQuery()->getDQL() and print that here?
Comment created by @guilhermeblanco:
As stated by this passing unit test:
This issue is invalid for assigned fix version.
Issue was closed with resolution "Invalid"