Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Adjust to changes in NodeType #3621

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions Classes/Domain/Model/Changes/AbstractStructuralChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
1 change: 0 additions & 1 deletion Classes/Fusion/Helper/NodeInfoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading