Skip to content

Commit a7aaa43

Browse files
committed
TASK: Adjust to changes in NodeType
Adjusts to changes to fix task neos/neos-development-collection#4515
1 parent 01dfa39 commit a7aaa43

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Classes/Domain/Model/Changes/AbstractStructuralChange.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,18 @@ protected function findChildNodes(Node $node): Nodes
186186

187187
protected function isNodeTypeAllowedAsChildNode(Node $node, NodeType $nodeType): bool
188188
{
189-
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node);
190-
if ($node->classification === NodeAggregateClassification::CLASSIFICATION_TETHERED) {
191-
$parentNode = $subgraph->findParentNode($node->nodeAggregateId);
192-
return !$parentNode || $this->getNodeType($parentNode)->allowsGrandchildNodeType(
193-
$node->nodeName->value,
194-
$nodeType
195-
);
196-
} else {
189+
if ($node->classification !== NodeAggregateClassification::CLASSIFICATION_TETHERED) {
197190
return $this->getNodeType($node)->allowsChildNodeType($nodeType);
198191
}
192+
193+
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node);
194+
$parentNode = $subgraph->findParentNode($node->nodeAggregateId);
195+
$nodeTypeManager = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId)->getNodeTypeManager();
196+
197+
return !$parentNode || $nodeTypeManager->isNodeTypeAllowedAsChildToTetheredNode(
198+
$this->getNodeType($parentNode),
199+
$node->nodeName,
200+
$nodeType
201+
);
199202
}
200203
}

0 commit comments

Comments
 (0)