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

Querying abstract class in the middle of a hierarchy returns NULL instead of objects #7059

Closed
BenMorel opened this issue Feb 12, 2018 · 5 comments
Assignees
Milestone

Comments

@BenMorel
Copy link
Contributor

I have the following entity hierarchy:

  • (A)
    • B
    • (C)
      • D
      • E

Abstract classes are in parentheses.

When querying entities of class A, B, D or E, everything works fine.
When querying entities of class C however, Doctrine 2.6.0 returns null instead of the entity object.

I created a test case here:
https://github.com/BenMorel/doctrine-abstract-entity-bug

The script creates 3 concrete entities of classes B, D and E, then queries every class of the hierarchy.
Doctrine 2.5.14 returns the correct result:

Bug\A:
    Bug\E
    Bug\D
    Bug\B
Bug\B:
    Bug\B
Bug\C:
    Bug\E
    Bug\D
Bug\D:
    Bug\D
Bug\E:
    Bug\E

Doctrine 2.6.0, however, fails here:

Bug\A:
    Bug\E
    Bug\D
    Bug\B
Bug\B:
    Bug\B
Bug\C:
    NULL          <!>
    NULL          <!>
Bug\D:
    Bug\D
Bug\E:
    Bug\E

As you can see, querying entities of class Bug\C returns NULL and NULL, instead of Bug\D and Bug\E as expected.

@BenMorel
Copy link
Contributor Author

Might be related to #6988, #6937, #7050.

@IljaN
Copy link

IljaN commented Feb 17, 2018

Also seeing same issue with inheritance type joined

@lcobucci
Copy link
Member

@BenMorel can you please check if #6988 fixes it?

@BenMorel
Copy link
Contributor Author

@lcobucci It works with #6988 ! 👍

@Ocramius
Copy link
Member

Handled in #6988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants