Closed totaltrash closed 8 years ago
The exception is telling you that there is an error in the declaration of your dependencies inside your fixtures.
maybe not so much #228
Should be fixed by #229 as well.
@totaltrash Can you confirm that #229 fixed your issue ?
Hmm, no #229 does not fix my issue. I'll try and get a test case together today.
More info @mikeSimonson - TopologicalSorter throws the exception on an abstract class that is providing a 'JOINED' inheritance type, and extended by two other classes. And, there is a relationship between those two classes. I've not confirmed that's the issue.
@mikeSimonson I've created an example 'application' to show where my issue is. I'll see if I can emulate how the dependencies get added by the purger so then should be able to create a test case. Anyway, check this out: https://github.com/totaltrash/example-data-fixtures. Can you please reopen this issue, or would you like me to open another?
@totaltrash can you try reproducing the issue within https://github.com/doctrine/data-fixtures/blob/b3cae5efef97191a08d53d733260f7eb667c16e4/tests/Doctrine/Tests/Common/DataFixtures/Sorter/TopologicalSorterTest.php ? You can dump the state of the TopologicalSorter
when the exception is thrown, too...
Lastly, I've dumped out how the dependencies get added to the topological sorter with that application above:
SubClassA has dependency SuperClass SubClassB has dependency SubClassA SuperClass has dependency SubClassA SubClassB has dependency SuperClass
The third line looks suspect - SuperClass (the abstract class) shouldn't be dependent on anything?
SuperClass
should depend on SubClassA
, but SubClassA
shouldn't depend on SuperClass
.
I don't know, is that what you would expect? SubClassA is the owning side of the relationship with SubClassB. That test application doesn't have a circular reference (it's two concrete entities connected by a many to many relationship). Both entities extend the same abstract class though... It's similar to the self referencing issue fixed earlier
This is happening even with no fixtures to load.
Since updating to v1.2.0, I get this when running purge: Doctrine\Common\DataFixtures\Exception\CircularReferenceException: Graph contains cyclic dependency.
Rolling back to v1.1.1, purge works fine.