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

        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)...
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: