Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDC-1201: DQL Example about count(*) related entity is wrong #1808

Closed
doctrinebot opened this issue Jun 10, 2011 · 2 comments
Closed

DDC-1201: DQL Example about count(*) related entity is wrong #1808

doctrinebot opened this issue Jun 10, 2011 · 2 comments
Assignees
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @beberlei:

DQL Example about count(*) related entity is wrong

@doctrinebot
Copy link
Author

Comment created by gedrox:

Also similar DQL in documentation URL http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results fails parsing stage:

$dql = "SELECT u, 'some scalar string', count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id";

with error

  [Doctrine\ORM\Query\QueryException]                                                                                                                         
  [Semantical Error] line 0, col 40 near 'localizations)': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. 

Should be "count(g.id)" instead of "count(u.groups)".

malukenho pushed a commit to malukenho/doctrine2 that referenced this issue Jan 3, 2017
malukenho pushed a commit to malukenho/doctrine2 that referenced this issue Jan 4, 2017
lcobucci added a commit that referenced this issue Jan 4, 2017
@lcobucci
Copy link
Member

lcobucci commented Jan 4, 2017

Fixed by #6212

@lcobucci lcobucci closed this as completed Jan 4, 2017
@Ocramius Ocramius added this to the 2.6.0 milestone Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants