Skip to content

Commit

Permalink
TASK: Remove absolute nodepath feature from nearestContentCollection
Browse files Browse the repository at this point in the history
This syntax is not required here
  • Loading branch information
mhsdesign committed Oct 11, 2024
1 parent 22993c5 commit d3a3013
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Neos.Neos/Classes/Fusion/Helper/NodeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,10 @@ public function nearestContentCollection(Node $node, string $nodePath): Node
$contentCollectionType
), 1409300545);
}
$nodePath = AbsoluteNodePath::patternIsMatchedByString($nodePath)
? AbsoluteNodePath::fromString($nodePath)
: NodePath::fromString($nodePath);
$nodePath = NodePath::fromString($nodePath);
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node);

$subNode = $nodePath instanceof AbsoluteNodePath
? $subgraph->findNodeByAbsolutePath($nodePath)
: $subgraph->findNodeByPath($nodePath, $node->aggregateId);
$subNode = $subgraph->findNodeByPath($nodePath, $node->aggregateId);

if ($subNode !== null && $this->isOfType($subNode, $contentCollectionType)) {
return $subNode;
Expand Down

0 comments on commit d3a3013

Please sign in to comment.