diff --git a/Classes/Domain/Model/Changes/AbstractCreate.php b/Classes/Domain/Model/Changes/AbstractCreate.php index 51839ee3b8..86aca9dc6a 100644 --- a/Classes/Domain/Model/Changes/AbstractCreate.php +++ b/Classes/Domain/Model/Changes/AbstractCreate.php @@ -97,9 +97,9 @@ protected function createNode( if (is_null($nodeTypeName)) { throw new \RuntimeException('Cannot run createNode without a set node type.', 1645577794); } - // TODO: the $name=... line should be as expressed below - // $name = $this->getName() ?: $this->nodeService->generateUniqueNodeName($parent->findParentNode()); - $nodeName = NodeName::fromString($this->getName() ?: uniqid('node-', false)); + $nodeName = $this->getName() + ? NodeName::fromString($this->getName()) + : null; $nodeAggregateId = NodeAggregateId::create(); // generate a new NodeAggregateId diff --git a/Classes/Domain/Model/Changes/AbstractStructuralChange.php b/Classes/Domain/Model/Changes/AbstractStructuralChange.php index 32cdfde7d7..b1a18ad614 100644 --- a/Classes/Domain/Model/Changes/AbstractStructuralChange.php +++ b/Classes/Domain/Model/Changes/AbstractStructuralChange.php @@ -15,6 +15,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\NodeType\NodeType; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; @@ -25,7 +26,6 @@ use Neos\Neos\Ui\Domain\Model\Feedback\Operations\RenderContentOutOfBand; use Neos\Neos\Ui\Domain\Model\Feedback\Operations\UpdateNodeInfo; use Neos\Neos\Ui\Domain\Model\RenderedNodeDomAddress; -use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper; /** * A change that performs structural actions like moving or creating nodes @@ -187,7 +187,7 @@ protected function findChildNodes(Node $node): Nodes protected function isNodeTypeAllowedAsChildNode(Node $node, NodeType $nodeType): bool { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - if (NodeInfoHelper::isAutoCreated($node, $subgraph)) { + if ($node->classification === NodeAggregateClassification::CLASSIFICATION_TETHERED) { $parentNode = $subgraph->findParentNode($node->nodeAggregateId); return !$parentNode || $parentNode->nodeType->allowsGrandchildNodeType( $node->nodeName->value, diff --git a/Classes/Fusion/Helper/NodeInfoHelper.php b/Classes/Fusion/Helper/NodeInfoHelper.php index 99242bd3de..cd816c265b 100644 --- a/Classes/Fusion/Helper/NodeInfoHelper.php +++ b/Classes/Fusion/Helper/NodeInfoHelper.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; use Neos\ContentRepository\Core\Projection\NodeHiddenState\NodeHiddenStateFinder; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\ProtectedContextAwareInterface; use Neos\Flow\Annotations as Flow; @@ -236,7 +237,7 @@ protected function getBasicNodeInformation(Node $node): array 'identifier' => $node->nodeAggregateId->jsonSerialize(), 'nodeType' => $node->nodeType->getName(), 'label' => $node->getLabel(), - 'isAutoCreated' => self::isAutoCreated($node, $subgraph), + 'isAutoCreated' => $node->classification === NodeAggregateClassification::CLASSIFICATION_TETHERED, // TODO: depth is expensive to calculate; maybe let's get rid of this? 'depth' => $subgraph->countAncestorNodes( $node->nodeAggregateId, @@ -251,17 +252,6 @@ protected function getBasicNodeInformation(Node $node): array ]; } - public static function isAutoCreated(Node $node, ContentSubgraphInterface $subgraph): bool - { - $parent = $subgraph->findParentNode($node->nodeAggregateId); - if ($parent) { - if (array_key_exists($node->nodeName->value, $parent->nodeType->getAutoCreatedChildNodes())) { - return true; - } - } - return false; - } - /** * Get information for all children of the given parent node. *