From 56953bdf7a9249e53e2af7965ea82f98c368ed17 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:09:04 +0100 Subject: [PATCH] TASK: Fully remove `aggregate=true` --- .../Classes/NodeType/NodeType.php | 19 ---------------- .../Unit/NodeType/NodeTypeManagerTest.php | 18 --------------- .../Controller/Service/NodesController.php | 22 ++++--------------- .../References/NodeTypeDefinition.rst | 10 --------- 4 files changed, 4 insertions(+), 65 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php index 77c3e27fbfa..56e88b3e18e 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php @@ -291,25 +291,6 @@ public function getDeclaredSuperTypes(): array }); } - /** - * Returns whether this node type (or any parent type) is an *aggregate*. - * - * The most prominent *aggregate* is a Document and everything which inherits from it, like a Page. - * - * If a node type is marked as aggregate, it means that: - * - * - the node type can "live on its own", i.e. can be part of an external URL - * - when moving this node, all node variants are also moved (across all dimensions) - * - Recursive copying only happens *inside* this aggregate, and stops at nested aggregates. - * - * @return boolean true if the node type is an aggregate - * @api - */ - public function isAggregate(): bool - { - return $this->getConfiguration('aggregate') === true; - } - /** * If this node type or any of the direct or indirect super types * has the given name. diff --git a/Neos.ContentRepository.Core/Tests/Unit/NodeType/NodeTypeManagerTest.php b/Neos.ContentRepository.Core/Tests/Unit/NodeType/NodeTypeManagerTest.php index 578378366ce..965c517754d 100644 --- a/Neos.ContentRepository.Core/Tests/Unit/NodeType/NodeTypeManagerTest.php +++ b/Neos.ContentRepository.Core/Tests/Unit/NodeType/NodeTypeManagerTest.php @@ -114,7 +114,6 @@ protected function prepareNodeTypeManager(array $nodeTypesFixtureData) ], 'Neos.ContentRepository.Testing:Document' => [ 'abstract' => true, - 'aggregate' => true ], 'Neos.ContentRepository.Testing:Page' => [ 'superTypes' => ['Neos.ContentRepository.Testing:Document' => true], @@ -273,23 +272,6 @@ public function getNodeTypeAllowsToRetrieveFinalNodeTypes() self::assertTrue($this->nodeTypeManager->getNodeType('Neos.ContentRepository.Testing:MyFinalType')->isFinal()); } - /** - * @test - */ - public function aggregateNodeTypeFlagIsFalseByDefault() - { - self::assertFalse($this->nodeTypeManager->getNodeType('Neos.ContentRepository.Testing:Text')->isAggregate()); - } - - /** - * @test - */ - public function aggregateNodeTypeFlagIsInherited() - { - self::assertTrue($this->nodeTypeManager->getNodeType('Neos.ContentRepository.Testing:Document')->isAggregate()); - self::assertTrue($this->nodeTypeManager->getNodeType('Neos.ContentRepository.Testing:Page')->isAggregate()); - } - /** * @test */ diff --git a/Neos.Neos/Classes/Controller/Service/NodesController.php b/Neos.Neos/Classes/Controller/Service/NodesController.php index 5b40ce7ddcf..d2ad504007b 100644 --- a/Neos.Neos/Classes/Controller/Service/NodesController.php +++ b/Neos.Neos/Classes/Controller/Service/NodesController.php @@ -331,17 +331,15 @@ protected function addExistingNodeVariantInformationToResponse( // If the node exists in another dimension, we want to know how many nodes in the rootline are also // missing for the target dimension. This is needed in the UI to tell the user if nodes will be // materialized recursively upwards in the rootline. To find the node path for the given identifier, - // we just use the first result. This is a safe assumption at least for "Document" nodes (aggregate=true), - // because they are always moved in-sync. - if ($nodeTypeManager->getNodeType($nodeAggregate->nodeTypeName)?->isAggregate()) { + // we just use the first result. This is a safe assumption at least for "Document" nodes , + // because they are always moved in-sync by default via (options.moveNodeStrategy=gatherAll). + if ($nodeTypeManager->getNodeType($nodeAggregate->nodeTypeName)?->isOfType(NodeTypeNameFactory::NAME_DOCUMENT)) { // TODO: we would need the SourceDimensions parameter (as in Create()) to ensure the correct // rootline is traversed. Here, we, as a workaround, simply use the 1st aggregate for now. $missingNodesOnRootline = 0; while ( - $parentAggregate = self::firstNodeAggregate( - $contentGraph->findParentNodeAggregates($identifier) - ) + $parentAggregate = $contentGraph->findParentNodeAggregates($identifier)->first() ) { if (!$parentAggregate->coversDimensionSpacePoint($dimensionSpacePoint)) { $missingNodesOnRootline++; @@ -361,18 +359,6 @@ protected function addExistingNodeVariantInformationToResponse( } } - /** - * @param iterable $nodeAggregates - * @return NodeAggregate|null - */ - private static function firstNodeAggregate(iterable $nodeAggregates): ?NodeAggregate - { - foreach ($nodeAggregates as $nodeAggregate) { - return $nodeAggregate; - } - return null; - } - /** * Adopt (translate) the given node and parents that are not yet visible to the given context * diff --git a/Neos.Neos/Documentation/References/NodeTypeDefinition.rst b/Neos.Neos/Documentation/References/NodeTypeDefinition.rst index 0af58d7631d..f7680a41b77 100644 --- a/Neos.Neos/Documentation/References/NodeTypeDefinition.rst +++ b/Neos.Neos/Documentation/References/NodeTypeDefinition.rst @@ -14,16 +14,6 @@ The following options are allowed for defining a NodeType: Abstract node types are useful when using inheritance and composition, so mark base node types and mixins as abstract. -``aggregate`` - A boolean flag, marking a node type as *aggregate*. If a node type is marked as aggregate, it means that: - - - the node type can "live on its own", i.e. can be part of an external URL - - when moving this node, all node variants are also moved (across all dimensions) - - Recursive copying only happens *inside* this aggregate, and stops at nested aggregates. - - The most prominent *aggregate* is `Neos.Neos:Document` and everything which inherits from it, like - `Neos.NodeTypes:Page`. - ``superTypes`` An array of parent node types as keys with a boolean value::