Skip to content

Commit

Permalink
BUGFIX: Don’t copy removed nodes
Browse files Browse the repository at this point in the history
With this change, removed nodes are not copied anymore
in the recursive copy actions. Also the removed state is kept
when a node is similarisied to prevent unpublished removed
nodes from popping up again inadvertendly.

Resolves: #5185
  • Loading branch information
Sebobo committed Jul 25, 2024
1 parent 606e5e0 commit d5687fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Neos.ContentRepository/Classes/Domain/Model/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,10 @@ protected function createRecursiveCopy(NodeInterface $referenceNode, string $nod
}
/** @var $childNode Node */
foreach ($this->getChildNodes() as $childNode) {
// Don't copy removed nodes
if ($childNode->isRemoved()) {
continue;
}
// Prevent recursive copy when copying into itself
if ($childNode->getIdentifier() !== $copiedNode->getIdentifier()) {
$childNode->copyIntoInternal($copiedNode, $childNode->getName(), $detachedCopy);
Expand Down
3 changes: 2 additions & 1 deletion Neos.ContentRepository/Classes/Domain/Model/NodeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,8 @@ public function similarize(AbstractNodeData $sourceNode, $isCopy = false)
'hiddenAfterDateTime',
'hiddenBeforeDateTime',
'hiddenInIndex',
'accessRoles'
'accessRoles',
'removed',
];
if (!$isCopy) {
$propertyNames[] = 'creationDateTime';
Expand Down

0 comments on commit d5687fd

Please sign in to comment.