diff --git a/Classes/Domain/Model/Changes/AbstractCreate.php b/Classes/Domain/Model/Changes/AbstractCreate.php index 118de197fd..cd8aa19595 100644 --- a/Classes/Domain/Model/Changes/AbstractCreate.php +++ b/Classes/Domain/Model/Changes/AbstractCreate.php @@ -127,7 +127,7 @@ public function getNodeAggregateId(): ?NodeAggregateId */ protected function createNode( Node $parentNode, - NodeAggregateId $succeedingSiblingNodeAggregateId = null + ?NodeAggregateId $succeedingSiblingNodeAggregateId = null ): Node { $nodeTypeName = $this->getNodeTypeName(); if (is_null($nodeTypeName)) { @@ -140,23 +140,21 @@ protected function createNode( throw new \RuntimeException(sprintf('Cannot run create node because the node type %s is missing.', $nodeTypeName->value), 1716019747); } - $nodeName = $this->getName() - ? NodeName::fromString($this->getName()) - : null; - $nodeAggregateId = $this->getNodeAggregateId() ?? NodeAggregateId::create(); // generate a new NodeAggregateId - $command = CreateNodeAggregateWithNode::create( $parentNode->workspaceName, $nodeAggregateId, $nodeTypeName, OriginDimensionSpacePoint::fromDimensionSpacePoint($parentNode->dimensionSpacePoint), $parentNode->aggregateId, - $succeedingSiblingNodeAggregateId, - $nodeName + $succeedingSiblingNodeAggregateId ); + if ($this->getName()) { + $command = $command->withNodeName(NodeName::fromString($this->getName())); + } + $commands = $this->applyNodeCreationHandlers( NodeCreationCommands::fromFirstCommand( $command, diff --git a/Classes/Domain/Model/Changes/CopyAfter.php b/Classes/Domain/Model/Changes/CopyAfter.php index a08e0ad744..30d3dfc638 100644 --- a/Classes/Domain/Model/Changes/CopyAfter.php +++ b/Classes/Domain/Model/Changes/CopyAfter.php @@ -72,8 +72,7 @@ public function apply(): void $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), $parentNodeOfPreviousSibling->aggregateId, - $succeedingSibling?->aggregateId, - null + $succeedingSibling?->aggregateId ); $contentRepository->handle($command); diff --git a/Classes/Domain/Model/Changes/CopyBefore.php b/Classes/Domain/Model/Changes/CopyBefore.php index d744f2b762..87e0881b6d 100644 --- a/Classes/Domain/Model/Changes/CopyBefore.php +++ b/Classes/Domain/Model/Changes/CopyBefore.php @@ -67,8 +67,7 @@ public function apply(): void $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), $parentNodeOfSucceedingSibling->aggregateId, - $succeedingSibling->aggregateId, - null + $succeedingSibling->aggregateId ); $contentRepository->handle($command); diff --git a/Classes/Domain/Model/Changes/CopyInto.php b/Classes/Domain/Model/Changes/CopyInto.php index 8e21e38346..8940173219 100644 --- a/Classes/Domain/Model/Changes/CopyInto.php +++ b/Classes/Domain/Model/Changes/CopyInto.php @@ -77,7 +77,6 @@ public function apply(): void $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->dimensionSpacePoint), $parentNode->aggregateId, - null, null ); $contentRepository->handle($command);