Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORMPurger failing after update to v1.2 #227

Closed
totaltrash opened this issue Jun 20, 2016 · 12 comments
Closed

ORMPurger failing after update to v1.2 #227

totaltrash opened this issue Jun 20, 2016 · 12 comments
Assignees
Milestone

Comments

@totaltrash
Copy link

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.

@mikeSimonson
Copy link
Contributor

The exception is telling you that there is an error in the declaration of your dependencies inside your fixtures.

@mikeSimonson
Copy link
Contributor

maybe not so much #228

@peterrehm
Copy link
Contributor

Should be fixed by #229 as well.

@mikeSimonson
Copy link
Contributor

@totaltrash Can you confirm that #229 fixed your issue ?

@Ocramius Ocramius added this to the 1.2.1 milestone Jun 20, 2016
@totaltrash
Copy link
Author

Hmm, no #229 does not fix my issue. I'll try and get a test case together today.

@totaltrash
Copy link
Author

totaltrash commented Jun 20, 2016

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.

@totaltrash
Copy link
Author

@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?

@Ocramius
Copy link
Member

@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...

@totaltrash
Copy link
Author

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?

@Ocramius
Copy link
Member

SuperClass should depend on SubClassA, but SubClassA shouldn't depend on SuperClass.

@totaltrash
Copy link
Author

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

tarokamikaze pushed a commit to tarokamikaze/data-fixtures that referenced this issue Jul 5, 2016
Total issues resolved: **3**
- [227: ORMPurger failing after update to v1.2](doctrine#227)
- [228: TopologicalSorter breaks fixture load](doctrine#228)
- [229: Added support for self referencing classes in the TopologicalSorter](doctrine#229)
@luispabon
Copy link

This is happening even with no fixtures to load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants