Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      "Entity\User\AbstractUser" is a base entity for user records, "Entity\User\Person" extends AbstractUser (Single Table inheritance in this case).
      The "Setting" property is a OneToOne relation with another entity.

      Now when I call this DQL:
      SELECT u, t FROM Entity\User\AbstractUser u LEFT JOIN u.Setting t

      The ObjectHydrator fails in line 276 ("if ( ! $relation->isOneToOne()) {"...) with "PHP Fatal error: Call to a member function isOneToOne() on a non-object in .../lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php".

      It works when using the sub class for the query:
      SELECT u, t FROM Entity\User\Person u LEFT JOIN u.Setting t

        Activity

        Nico Kaiser created issue -
        Hide
        Nico Kaiser added a comment -

        It seems like ObjectHydrator::_hydrateRow tries to find a _ce entry for AbstractUser (but _ce only holds entries for Person)...

        Show
        Nico Kaiser added a comment - It seems like ObjectHydrator::_hydrateRow tries to find a _ce entry for AbstractUser (but _ce only holds entries for Person)...
        Roman S. Borschel made changes -
        Field Original Value New Value
        Affects Version/s 2.0-ALPHA3 [ 10029 ]
        Fix Version/s 2.0-ALPHA4 [ 10036 ]
        Roman S. Borschel made changes -
        Priority Major [ 3 ] Critical [ 2 ]
        Roman S. Borschel made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Roman S. Borschel added a comment -

        Does Setting use inheritance also? TopnewsSetting extends Setting? If so which inheritance type?

        Show
        Roman S. Borschel added a comment - Does Setting use inheritance also? TopnewsSetting extends Setting? If so which inheritance type?
        Hide
        Roman S. Borschel added a comment -

        Can we see the classes and their mappings? AbstractUser, User, Setting and TopnewsSetting. Then I can set up a test to reproduce it. Thanks!

        Show
        Roman S. Borschel added a comment - Can we see the classes and their mappings? AbstractUser, User, Setting and TopnewsSetting. Then I can set up a test to reproduce it. Thanks!
        Hide
        Nico Kaiser added a comment -

        Oh no I forgot to change TopnewsSetting to Setting in this report, there is no inheritance, just copy & paste bug.

        Show
        Nico Kaiser added a comment - Oh no I forgot to change TopnewsSetting to Setting in this report, there is no inheritance, just copy & paste bug.
        Nico Kaiser made changes -
        Description "Entity\User\AbstractUser" is a base entity for user records, "Entity\User\Person" extends AbstractUser (Single Table inheritance in this case).
        The "Setting" property is a OneToOne relation with another entity.

        Now when I call this DQL:
        {{SELECT u, t FROM Entity\User\AbstractUser u LEFT JOIN u.Setting t}}

        The ObjectHydrator fails in line 276 ("if ( ! $relation->isOneToOne()) {"...) with "PHP Fatal error: Call to a member function isOneToOne() on a non-object in .../lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php".

        It works when using the sub class for the query:
        {{SELECT u, t FROM Entity\User\Person u LEFT JOIN u.TopnewsSetting t}}
        "Entity\User\AbstractUser" is a base entity for user records, "Entity\User\Person" extends AbstractUser (Single Table inheritance in this case).
        The "Setting" property is a OneToOne relation with another entity.

        Now when I call this DQL:
        {{SELECT u, t FROM Entity\User\AbstractUser u LEFT JOIN u.Setting t}}

        The ObjectHydrator fails in line 276 ("if ( ! $relation->isOneToOne()) {"...) with "PHP Fatal error: Call to a member function isOneToOne() on a non-object in .../lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php".

        It works when using the sub class for the query:
        {{SELECT u, t FROM Entity\User\Person u LEFT JOIN u.Setting t}}
        Hide
        Nico Kaiser added a comment -

        Here are the classes and example code:

        http://pastie.org/private/ljkiowarvm9trhdyug903q

        Show
        Nico Kaiser added a comment - Here are the classes and example code: http://pastie.org/private/ljkiowarvm9trhdyug903q
        Hide
        Roman S. Borschel added a comment -

        Successfully reproduced in our test suite and working on it.

        Show
        Roman S. Borschel added a comment - Successfully reproduced in our test suite and working on it.
        Hide
        Roman S. Borschel added a comment -

        Should be fixed now. Thanks for reporting.

        Show
        Roman S. Borschel added a comment - Should be fixed now. Thanks for reporting.
        Roman S. Borschel made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 10542 ] jira-feedback [ 15499 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15499 ] jira-feedback2 [ 17363 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17363 ] jira-feedback3 [ 19620 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-187, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Nico Kaiser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: