DDC-234: CLONE -createQueryBuilder does not insert alias into "from" part #287

Closed
opened 2026-01-22 12:33:34 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 4, 2010).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user cloun:

When using createQueryBuilder() the dql created throws an error when executed:

Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got 'LEFT'

The dql created is missing the alias after "from".

Originally created by @doctrinebot on GitHub (Jan 4, 2010). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user cloun: When using createQueryBuilder() the dql created throws an error when executed: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got 'LEFT' The dql created is missing the alias after "from".
admin added the Bug label 2026-01-22 12:33:34 +01:00
admin closed this issue 2026-01-22 12:33:34 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 4, 2010):

Comment created by cloun:

The same issue in trunk

@doctrinebot commented on GitHub (Jan 4, 2010): Comment created by cloun: The same issue in trunk
Author
Owner

@doctrinebot commented on GitHub (Jan 4, 2010):

Comment created by @guilhermeblanco:

You must define an alias for all situations (update and select queries included).

Closing ticket. If I made something wrong, reopen it and provide more informations.

Thanks

@doctrinebot commented on GitHub (Jan 4, 2010): Comment created by @guilhermeblanco: You must define an alias for all situations (update and select queries included). Closing ticket. If I made something wrong, reopen it and provide more informations. Thanks
Author
Owner

@doctrinebot commented on GitHub (Jan 5, 2010):

Comment created by cloun:

Thanks for fix, but it is not all. Please, look at EntityRepository->createQueryBuilder method. Specified alias is not pushed into 'from' method. I suggest:

public function createQueryBuilder($alias)
{
   return $this->_em->createQueryBuilder()
        ->select($alias)
        ->from($this->_entityName, $alias); //the second parameter lost
}
@doctrinebot commented on GitHub (Jan 5, 2010): Comment created by cloun: Thanks for fix, but it is not all. Please, look at EntityRepository->createQueryBuilder method. Specified alias is not pushed into 'from' method. I suggest: ``` public function createQueryBuilder($alias) { return $this->_em->createQueryBuilder() ->select($alias) ->from($this->_entityName, $alias); //the second parameter lost } ```
Author
Owner

@doctrinebot commented on GitHub (Jan 5, 2010):

Comment created by @guilhermeblanco:

In r7006 this issue was fixed. Thanks for the clear report now... it saves quite some time =)
Also thanks for the patch!

Cheers,

@doctrinebot commented on GitHub (Jan 5, 2010): Comment created by @guilhermeblanco: In r7006 this issue was fixed. Thanks for the clear report now... it saves quite some time =) Also thanks for the patch! Cheers,
Author
Owner

@doctrinebot commented on GitHub (Jan 5, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 5, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Jan 6, 2010):

Comment created by cloun:

Thanks for fix =)

@doctrinebot commented on GitHub (Jan 6, 2010): Comment created by cloun: Thanks for fix =)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#287