Skip to content

Commit

Permalink
BUGFIX: Copy/Paste across dimensions should not lead to error
Browse files Browse the repository at this point in the history
Resolves: #4614
  • Loading branch information
skurfuerst committed Oct 21, 2024
1 parent 0448005 commit 4b6366d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Classes/Domain/Model/Changes/CopyAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
4 changes: 3 additions & 1 deletion Classes/Domain/Model/Changes/CopyBefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
4 changes: 3 additions & 1 deletion Classes/Domain/Model/Changes/CopyInto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 4b6366d

Please sign in to comment.