Jira issue originally created by user koc:
* @Orm\Column(type="integer", name="id")
* @Orm\ManyToOne(targetEntity="Page", inversedBy="children")
* @Orm\JoinColumn(name="pid", referencedColumnName="id")
/*** @Orm\OneToMany(targetEntity="Page", mappedBy="parent") **/
/*** @Orm\Column(name="page_title") **/
$id = 5;
// step 1
$page = $this
SELECT p, parent
FROM OloloContentBundle:Page p
LEFT JOIN p.parent parent
WHERE p.id = :id
// step 2
$page = $this->getEntityManager('read')->find('OloloContentBundle:Page', $id);
var_dump($page->getParent()->getParent()); // expected instance of Page, but got null
When I added one more fetch join for parent then I got Page.
Comment created by @beberlei:
Can you test against master again? I made a fix in context of DDC-1452 that i think could solve this issue.
Comment created by koc:
I will do it
I cann't run master branch on current env (Symfony 2.0.2).
MappingException: The association mapping 'eventArea' misses the 'targetEntity' attribute, but targetEntity present. Can you merge fix into 2.1.x branch?
I am not sure this fix is mergable in 2.1, also it is a rather complex change that i don't want to merge back to the stable branch for stability reasons.
Let me try to reproduce this in a test and then go further from there.
DDC-1452 is indeed the same bug as this one and the fix works.
I cant merge this as with the latest refactorings it gives hundrets of conflicts, but will re-apply manually.
Backported and fixed in 2.1.x
Issue was closed with resolution "Fixed"
Thank you very much, Benjamin!