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

"Entity has to be managed or scheduled for removal for single computation" on publish moved nodes #35

Closed
dlubitz opened this issue Jul 11, 2024 · 4 comments · Fixed by #36
Assignees
Labels

Comments

@dlubitz
Copy link
Contributor

dlubitz commented Jul 11, 2024

Description
If I move a node to a parent, where already a sourceuripath exists, because the node was moved away from this parent before, the Doctrine Entitymanager throws an exception "Entity has to be managed or scheduled for removal for single computation".

Steps to reproduce

  • Create a node in two dimensions and publish all
  • Move the node below a new parent and publish all
  • Move the node back to old parent and publish all (if you publish each dimension alone, it works)

What I already know
This behavior started with doctrine/orm: "2.19.5", caused by this change: doctrine/orm#11428

The UnitOfWork checks the state of each entity on change set computation: https://github.com/doctrine/orm/blob/2.19.x/src/UnitOfWork.php#L573

This seems to be affected by the change above.

Might be related: doctrine/orm#11480

Affected Version: 5.0.4

@kdambekalns
Copy link
Member

What about catching the exception instead of checking the state? If that is an exceptional case (as an exception should be), that might be cheaper…

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 12, 2024

Hmm, yes. This works too. But in both cases we rely somehow on internal logic of doctrine.

@kdambekalns
Copy link
Member

But in both cases we rely somehow on internal logic of doctrine.

True. But catching an exception seems "more distant" than checking a state because you know that's what raises an exception. No?

@dlubitz
Copy link
Contributor Author

dlubitz commented Jul 12, 2024

I like the "second account" apporach. Feels more crowdy here. 😁

EDIT: Damn it, you tricked me

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

Successfully merging a pull request may close this issue.

3 participants