A cycle has been detected, so a topological sort is not possible. The getCycle() method provides the list of nodes that form the cycle. #11438
Unanswered
collmomo
asked this question in
Support Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug Report
Summary
The following message get thrown: "A cycle has been detected, so a topological sort is not possible. The getCycle() method provides the list of nodes that form the cycle." after removing/flushing an entity while using semantically correct doctrine syntax and sound logic
Current behavior
Blocking the flush process from removing the entity while using
OneToOne
relations.More context here: Stackoverflow
How to reproduce
OneToOne relations with
self
usingcascade:remove
Expected behavior
Don't throw the error, there's no cycle (infinite loop?) here, just remove the entity.
I fixed the issue by adding the following attribute:
#[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
Another solution could have been to manually clear the relations before removing the entity:
Beta Was this translation helpful? Give feedback.
All reactions