File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Classes/Domain/Model/Changes Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -186,15 +186,18 @@ protected function findChildNodes(Node $node): Nodes
186
186
187
187
protected function isNodeTypeAllowedAsChildNode (Node $ node , NodeType $ nodeType ): bool
188
188
{
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 ) {
197
190
return $ this ->getNodeType ($ node )->allowsChildNodeType ($ nodeType );
198
191
}
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
+ );
199
202
}
200
203
}
You can’t perform that action at this time.
0 commit comments