Skip to content

Commit

Permalink
Merge pull request #4578 from neos/bugfix/only-discard-nodes-in-same-…
Browse files Browse the repository at this point in the history
…workspace

BUGFIX: Only discard nodes in same workspace
  • Loading branch information
Sebobo authored Oct 20, 2023
2 parents db63fe0 + 595fcba commit dfd4d89
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ protected function doDiscardNode(NodeInterface $node, array &$alreadyDiscardedNo
if ($possibleShadowNodeData instanceof NodeData) {
if ($possibleShadowNodeData->getMovedTo() !== null) {
$parentBasePath = $node->getPath();
$affectedChildNodeDataInSameWorkspace = $this->nodeDataRepository->findByParentAndNodeType($parentBasePath, null, $node->getWorkspace(), null, false, true);
foreach ($affectedChildNodeDataInSameWorkspace as $affectedChildNodeData) {
$affectedChildNodeDataInWorkspaceChain = $this->nodeDataRepository->findByParentAndNodeType($parentBasePath, null, $node->getWorkspace(), null, false, true);
foreach ($affectedChildNodeDataInWorkspaceChain as $affectedChildNodeData) {
if (!$affectedChildNodeData->matchesWorkspaceAndDimensions($node->getWorkspace(), $node->getDimensions())) {
continue;
}
/** @var NodeData $affectedChildNodeData */
$affectedChildNode = $this->nodeFactory->createFromNodeData($affectedChildNodeData, $node->getContext());
$this->doDiscardNode($affectedChildNode, $alreadyDiscardedNodeIdentifiers);
Expand Down

0 comments on commit dfd4d89

Please sign in to comment.