doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.86k stars 2.5k forks source link

Add regression test for #8108 #11523

Open Jean85 opened 6 days ago

Jean85 commented 6 days ago

As reported in https://github.com/doctrine/orm/issues/8108#issuecomment-2188230072, this is a regression test for a bug that I encounter when upgrading from ORM 2 to 3. I'm not sure how this should be fixed.

[EDIT] I should add that this doesn't happen if the relation is coming from a trait instead of an abstract class.

Jean85 commented 1 hour ago

Ok I've debugged the issue, that lies in \Doctrine\ORM\Mapping\Driver\ReflectionBasedDriver::isRepeatedPropertyDeclaration:

Any suggestion on how we should fix this?

[EDIT] In short, it seems that the issue stems from the fact that I'm having this chain of inheritance:

  1. class A (NOT declared as an entity) with a relation / field declared on a property
  2. class B extends A, declared as mapped superclass
  3. class C extends B, declared as child entity of B