mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2191: Bug in QueryBuilder::add() method, param $append has no effect for where/having DQL parts #2758
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Dec 7, 2012).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user relo_san:
Now
$appendparam ofQueryBuilder::add()method has no effect forwhereandhavingparts.In example:
will result in the loss of condition
u.some = ?1Explanation in code
526 line of
Doctrine/ORM/QueryBuilder.php, part of bodyadd()method:According to the code above
$appendparameter is checked in conjunction with$isMultiplevariable, which is:But in 56 line of this file, class property
\*dqlPartskeyswhereandhavingare equal _null*:As a result, for the parts
whereandhavingcondition $append && $isMultiple will never be true, regardless of$appendvalue.I can offer a patch on Github to fix this bug, if necessary.
@doctrinebot commented on GitHub (Jan 6, 2013):
Comment created by @beberlei:
This was and will never be allowed, i introduced an exception to show a way out, you need to look at QueryBuilder#andWhere for example to see a solution to append to where clauses.
@doctrinebot commented on GitHub (Jan 6, 2013):
Issue was closed with resolution "Fixed"