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
Discarding nodes tries to discard node from base workspace #4577
Comments
Is there a way to reproduce that behavior? |
So far I was only able to reproduce this in my customers project but not in the demo yet as it got a bit late yesterday. |
But it must be something like this: You have the workspace chain You modify a content element in Then try to discard the changes from Still thinking about the Problem with only live + A and the thrown exception that live has no base workspace. |
Based on the place in the code, it needs to be some moved node, right? |
Modified should be enough, why do you think moved? |
It's all located in the iteration of the result of neos-development-collection/Neos.ContentRepository/Classes/Domain/Service/PublishingService.php Lines 181 to 197 in cf4077d
|
Ah yes 🤦 |
If a node is moved in a sub workspace it’s possible that childnodes from the base workspace are returned and discarded. If the parent workspace is live, this will lead to an exception in the workspace module, if it’s another shared workspace it might even discard nodes from it. Resolves: #4577
I'm currently working on a bug for a customer in which they get errors when trying to discard/delete several workspaces.
Neos runs into an exception as nodes from "live" cannot be discarded as it has no base workspace.
So the
PublishingService->doDiscardNode
collects child nodes of the nodes in the desired workspace, butnodeDataRepository->findByParentAndNodeType
returns a mixed list of child nodes from "live" and the target workspace.See
neos-development-collection/Neos.ContentRepository/Classes/Domain/Service/PublishingService.php
Line 185 in f328dd8
I currently don't see exactly where
findByParentAndNodeType
makes sure that only matching nodes are returned.So IMO the correct solution must be to add the following check before trying to discard the found child nodes:
The bug only appears since they upgraded to 8.3, but it might affect 7.3 too and something else had changed.
The text was updated successfully, but these errors were encountered: