Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Enforce unique names also for root children #4982

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,6 @@ public function findTetheredChildNodeAggregates(
return $this->mapQueryBuilderToNodeAggregates($queryBuilder, $contentStreamId);
}

/**
* @param ContentStreamId $contentStreamId
* @param NodeName $nodeName
* @param NodeAggregateId $parentNodeAggregateId
* @param OriginDimensionSpacePoint $parentNodeOriginDimensionSpacePoint
* @param DimensionSpacePointSet $dimensionSpacePointsToCheck
* @return DimensionSpacePointSet
*/
public function getDimensionSpacePointsOccupiedByChildNodeName(
ContentStreamId $contentStreamId,
NodeName $nodeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ Feature: Create node aggregate with node
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| nodeTypeName | "Neos.ContentRepository.Testing:Node" |
| originDimensionSpacePoint | {} |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeName | "document" |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,22 @@ Feature: Create node aggregate with node
| parentNodeAggregateId | "sir-david-nodenborough" |
| originDimensionSpacePoint | {"language":"de"} |
Then the last command should have thrown an exception of type "NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint"

Scenario: Try to create a node aggregate with a root parent and a sibling already claiming the name
# root nodes are special in that they have the empty DSP as origin, wich may affect constraint checks
When the command CreateNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "sir-david-nodenborough" |
| nodeTypeName | "Neos.ContentRepository.Testing:Node" |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| originDimensionSpacePoint | {"language":"de"} |
| nodeName | "document" |
And the graph projection is fully up to date
And the command CreateNodeAggregateWithNode is executed with payload and exceptions are caught:
| Key | Value |
| nodeAggregateId | "nody-mc-nodeface" |
| nodeTypeName | "Neos.ContentRepository.Testing:Node" |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| originDimensionSpacePoint | {"language":"de"} |
mhsdesign marked this conversation as resolved.
Show resolved Hide resolved
| nodeName | "document" |
Then the last command should have thrown an exception of type "NodeNameIsAlreadyOccupied"
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties(
$contentStreamId,
$command->nodeName,
$command->parentNodeAggregateId,
$command->originDimensionSpacePoint,
$parentNodeAggregate->classification->isRoot()
? DimensionSpace\OriginDimensionSpacePoint::createWithoutDimensions()
: $command->originDimensionSpacePoint,
$coveredDimensionSpacePoints,
$contentRepository
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ private function handleCopyNodesRecursively(
$contentStreamId,
$command->targetNodeName,
$command->targetParentNodeAggregateId,
$command->targetDimensionSpacePoint,
$parentNodeAggregate->classification->isRoot()
? OriginDimensionSpacePoint::createWithoutDimensions()
: $command->targetDimensionSpacePoint,
$coveredDimensionSpacePoints,
$contentRepository
);
Expand Down
Loading