mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-184: Infinite recursion on toArray() with manyToMany bidirectional relationships #227
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 30, 2009).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user russ:
When specifying a bidirectional @manyToMany relationship, the Doctrine ActiveRecord locks up on toArray(). Line 154 ($array[$name] = $this->toArray($value);) is run thousands of times, presumably because the relations are constantly loading each other.
Everything works fine when I comment out that line, but that will surely break something else somewhere!
Hydrating these objects as arrays also works fine.
@doctrinebot commented on GitHub (Nov 30, 2009):
Comment created by romanb:
Is this probably related to the sfDoctrine2Plugin ? Since there is no ActiveRecord / toArray in Doctrine 2 itself.
@doctrinebot commented on GitHub (Nov 30, 2009):
Comment created by russ:
Attached patch: Stab in the dark but this makes sense and seems to solve the problem for me
@doctrinebot commented on GitHub (Nov 30, 2009):
Comment created by russ:
@Roman, yes - is Active_Record maintained separately somewhere?
I'm not entirely sure if it's a problem with Active_Record or a problem with the Doctrine metadata, but adding the dirty state at least seems to fix the problem for me.
@doctrinebot commented on GitHub (Nov 30, 2009):
Comment created by romanb:
Yes, I think it is maintained in the symfony trac and svn. I will assign this to Jon here anyway.
@doctrinebot commented on GitHub (Dec 7, 2009):
Comment created by @jwage:
It is a Doctrine extension. Maybe we can use Jira projects for extensions? It is a tough decision because eventually we may have a lot of extensions and it would clutter Jira. I think maybe we might use github to host all Doctrine extensions and mirror them to our SVN or something.
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by @guilhermeblanco:
In r6903 this issue was fixed! Thanks for the patch!
@doctrinebot commented on GitHub (Dec 9, 2009):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/661786b3f62271677178