diff --git a/Classes/Domain/Model/Changes/AbstractStructuralChange.php b/Classes/Domain/Model/Changes/AbstractStructuralChange.php index f4eb59d5a1..127c08005f 100644 --- a/Classes/Domain/Model/Changes/AbstractStructuralChange.php +++ b/Classes/Domain/Model/Changes/AbstractStructuralChange.php @@ -186,15 +186,18 @@ protected function findChildNodes(Node $node): Nodes protected function isNodeTypeAllowedAsChildNode(Node $node, NodeType $nodeType): bool { - $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - if ($node->classification === NodeAggregateClassification::CLASSIFICATION_TETHERED) { - $parentNode = $subgraph->findParentNode($node->nodeAggregateId); - return !$parentNode || $this->getNodeType($parentNode)->allowsGrandchildNodeType( - $node->nodeName->value, - $nodeType - ); - } else { + if ($node->classification !== NodeAggregateClassification::CLASSIFICATION_TETHERED) { return $this->getNodeType($node)->allowsChildNodeType($nodeType); } + + $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); + $parentNode = $subgraph->findParentNode($node->nodeAggregateId); + $nodeTypeManager = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId)->getNodeTypeManager(); + + return !$parentNode || $nodeTypeManager->isNodeTypeAllowedAsChildToTetheredNode( + $this->getNodeType($parentNode), + $node->nodeName, + $nodeType + ); } } diff --git a/Classes/Fusion/Helper/NodeInfoHelper.php b/Classes/Fusion/Helper/NodeInfoHelper.php index 62abda3f3c..6de4667f91 100644 --- a/Classes/Fusion/Helper/NodeInfoHelper.php +++ b/Classes/Fusion/Helper/NodeInfoHelper.php @@ -11,7 +11,6 @@ * source code. */ -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node;