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-3336: Undefined property: Doctrine\ORM\Query\AST\SimpleArithmeticExpression::$field #4133

Closed
doctrinebot opened this issue Oct 4, 2014 · 10 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user darkangel:

I upgraded from 2.4.1 to 2.4.4, and now I'm seeing this notice here & there:

{quote}Undefined property: Doctrine\ORM\Query\AST\SimpleArithmeticExpression::$field in /*/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php on line 200{quote}

This seems to be in a method with the description "Generates new SQL for Postgresql or Oracle if necessary." ... but we're on MySQL (Percona).

@doctrinebot
Copy link
Author

Comment created by darkangel:

Changed this to critical. It's also screwing up ordering, for example:

SELECT tp, p, CASE WHEN tp.memberTo IS NULL THEN 1 ELSE 0 END AS HIDDEN ord FROM Tournaments*Model*TeamPlayer tp INNER JOIN tp.player p LEFT JOIN p.user u WHERE tp.team = ?1 ORDER BY ord DESC, tp.memberFrom ASC

The paginator doesn't order the data correctly unless I remove the 2nd order by (tp.memberFrom ASC). The generated SQL from the QB/DQL is correct, so the paginator must be messing something up.

See: http://www.doctrine-project.org/jira/browse/[DDC-1958](http://www.doctrine-project.org/jira/browse/DDC-1958)?focusedCommentId=24010&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-24010

@doctrinebot
Copy link
Author

Comment created by @Ocramius:

Need a test case in order to verify the issue

@doctrinebot
Copy link
Author

Comment created by darkangel:

Okay, try this:

        $qb->from('Team', 't')
              ->select('t')
              ->orderBy('(1-1000)*1', 'DESC')
              ->getQuery()
              ->getResult();

This is simplified, the actual query works with field values, like this:

        ->orderBy('(((t.eloRating-1000)*t.reliability) + 1000)', 'DESC')

This causes the first issue.

@doctrinebot
Copy link
Author

Comment created by darkangel:

The second issue is explained by Guilherme Santos.

@doctrinebot
Copy link
Author

Comment created by @Ocramius:

The first comment goes to a new issue.

@doctrinebot
Copy link
Author

Comment created by @Ocramius:

Moved that issue to DDC-3434

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1211] was closed:
#1211

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1211] was assigned:
#1211

@doctrinebot doctrinebot added this to the 2.4.7 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants