Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1591

Paginator: ResultVariable cannot be used in HavingClause

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Using the QueryBuilder, I'm getting the message

      Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2128
      

      when trying to add a "having" clause for the field "distance", which is defined in the "select" part of the statement:

      $queryBuilder
          ->select('myEntity, MY_FUNCTION() AS distance')
          ->having('distance <= 10')
      ;
      

        Activity

        Hide
        Christian Raue added a comment -

        But I am using the QueryBuilder and then passing the query to a DoctrineORMAdapter instance. The error message didn't change, just the line number:

        Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2142
        

        But I can confirm that this error doesn't occur when not using a paginator. How to continue?

        Show
        Christian Raue added a comment - But I am using the QueryBuilder and then passing the query to a DoctrineORMAdapter instance. The error message didn't change, just the line number: Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2142 But I can confirm that this error doesn't occur when not using a paginator. How to continue?
        Hide
        Benjamin Eberlei added a comment -

        Which paginator are you using?

        Show
        Benjamin Eberlei added a comment - Which paginator are you using?
        Hide
        Christian Raue added a comment - - edited
        Show
        Christian Raue added a comment - - edited Still https://github.com/whiteoctober/Pagerfanta/
        Hide
        Benjamin Eberlei added a comment -

        Renamed and assigned issue.

        Show
        Benjamin Eberlei added a comment - Renamed and assigned issue.
        Hide
        Alexander added a comment -

        Fixed as sander was kind enough to resubmit the code to the doctrine2 repository now instead:
        https://github.com/doctrine/doctrine2/pull/298

        Show
        Alexander added a comment - Fixed as sander was kind enough to resubmit the code to the doctrine2 repository now instead: https://github.com/doctrine/doctrine2/pull/298

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Christian Raue
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: