mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3018: DQL “NEW” Operator and Literal type "String" #3749
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 (Mar 9, 2014).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user ehar:
Hello all,
When i use the DQL operator "new" to build data transfert object with string literal expression as field in object constructor, the call to
Query::getResultthrown an exception.Condition :
The string literal expression must be the first parameter of the constructor.
Following DQL :
Thrown exception :
{quote}
ContextErrorException: Notice: Undefined variable: fieldType in doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php line 1527
{quote}
That happens because in
SqlWalker::walkNewObjecton theAST\Literalswitch case. There is no case forAST\Literal::STRING, so$fieldTypeisn't defined.I have also noted if the scalar string isn't the first parameter, $fieldType take the type of previous foreach element.
@doctrinebot commented on GitHub (Mar 23, 2014):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Mar 23, 2014):
Comment created by @beberlei:
Fixed and merged into 2.4 release branch