Skip to content

Commit

Permalink
Merge pull request #4966 from neos/catchRootNodeAdjustments
Browse files Browse the repository at this point in the history
BUGFIX: Catch not completely covered node aggregates
  • Loading branch information
bwaidelich committed Apr 26, 2024
2 parents dab3d0b + ee7c85b commit 7519d97
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Neos\ContentRepository\StructureAdjustment\Adjustment;

use Neos\ContentRepository\Core\DimensionSpace\InterDimensionalVariationGraph;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\DimensionSpace\VariantType;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
Expand All @@ -29,6 +30,16 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): iterable
return [];
}
if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) {
foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) {
if (
!$nodeAggregate->coveredDimensionSpacePoints->equals($this->interDimensionalVariationGraph->getDimensionSpacePoints())
) {
throw new \Exception(
'Cannot determine structure adjustments for root node type ' . $nodeTypeName->value
. ', run UpdateRootNodeAggregateDimensions first'
);
}
}
return [];
}
foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) {
Expand Down

0 comments on commit 7519d97

Please sign in to comment.