diff --git a/Classes/Domain/Model/Changes/CopyAfter.php b/Classes/Domain/Model/Changes/CopyAfter.php index 30d3dfc638..9030f845e7 100644 --- a/Classes/Domain/Model/Changes/CopyAfter.php +++ b/Classes/Domain/Model/Changes/CopyAfter.php @@ -70,7 +70,9 @@ public function apply(): void ), $subject->workspaceName, $subject, - OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), + // NOTE: in order to be able to copy/paste across dimensions, we need to use + // the TARGET NODE's DimensionSpacePoint to create the node in the target dimension. + OriginDimensionSpacePoint::fromDimensionSpacePoint($previousSibling->dimensionSpacePoint), $parentNodeOfPreviousSibling->aggregateId, $succeedingSibling?->aggregateId ); diff --git a/Classes/Domain/Model/Changes/CopyBefore.php b/Classes/Domain/Model/Changes/CopyBefore.php index 87e0881b6d..b42fd16df8 100644 --- a/Classes/Domain/Model/Changes/CopyBefore.php +++ b/Classes/Domain/Model/Changes/CopyBefore.php @@ -65,7 +65,9 @@ public function apply(): void ), $subject->workspaceName, $subject, - OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), + // NOTE: in order to be able to copy/paste across dimensions, we need to use + // the TARGET NODE's DimensionSpacePoint to create the node in the target dimension. + OriginDimensionSpacePoint::fromDimensionSpacePoint($succeedingSibling->dimensionSpacePoint), $parentNodeOfSucceedingSibling->aggregateId, $succeedingSibling->aggregateId ); diff --git a/Classes/Domain/Model/Changes/CopyInto.php b/Classes/Domain/Model/Changes/CopyInto.php index bdd1188b7a..e8cd6f1a68 100644 --- a/Classes/Domain/Model/Changes/CopyInto.php +++ b/Classes/Domain/Model/Changes/CopyInto.php @@ -74,7 +74,9 @@ public function apply(): void ), $subject->workspaceName, $subject, - OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), + // NOTE: in order to be able to copy/paste across dimensions, we need to use + // the TARGET NODE's DimensionSpacePoint to create the node in the target dimension. + OriginDimensionSpacePoint::fromDimensionSpacePoint($parentNode->dimensionSpacePoint), $parentNode->aggregateId, null );