Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.2.2
-
Fix Version/s: None
-
Component/s: ORM
-
Labels:None
-
Environment:Windows + latest XAMPP
Description
I am getting the fatal error "Call to a member function toArray() on a non-object" which is triggered in Doctrine/ORM/PersistentCollection.php on line 239 by $this->snapshot = $this->coll->toArray();
{{
SELECT i, c FROM Page i
LEFT JOIN i.children c
WHERE i.parent_id IS NULL
AND i.site = ?1
ORDER BY i.id ASC
}}
The association is self-referential on the column parent_id. Removing "LEFT" from the query makes is run successfully (but ofc not in the way I need it). Making it only select 'i' instead of 'i, c' also solves it. But I don't think it's wrong in it's current form is it?
The Entity (slightly truncated to remove personal/local info) is at http://scrp.at/bvl
can you paste the full stack trace when the error occurs? Xdebug shows this.