Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1227

On 2.1 upgrade QueryBuilder incompatability getAlias() when using ''->add('select', 'sample')->add('from', 'Samply sample') instead of ->select('sample')->from('Sample', 'sample')

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      ubuntu 10.10, php 5.3.5,

      Description

      In queryBuilder if I use the add function when adding components to the query I get an error like this :

      Fatal error: Call to a member function getAlias() on a non-object in /usr/local/zend/share/pear/Doctrine/ORM/QueryBuilder.php on line 989

      sample code is

      $this->em->createQueryBuilder()
      		    ->add('select', 'sample')
      		    ->add('from', 'Sample sample')
      		    ->getQuery()
      		    ->execute()
      

      it works with the following:

      $this->em->createQueryBuilder()
      		    ->select('sample')
      		    ->from('Sample', 'sample')
      		    ->getQuery()
      		    ->execute()
      

      I apologize if this is a duplicate ticket. I would like to see this fixed in the final release of 2.1 before installing it in our production environment.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Formatting

        Show
        Benjamin Eberlei added a comment - Formatting
        Hide
        Benjamin Eberlei added a comment -

        Fixed, thanks! You qualify for a mug/t-shirt after 2.1 release

        Show
        Benjamin Eberlei added a comment - Fixed, thanks! You qualify for a mug/t-shirt after 2.1 release

          People

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

            Dates

            • Created:
              Updated:
              Resolved: