Skip to content

Commit

Permalink
Adjust to Neos9 beta 11 (and 12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed Aug 27, 2024
1 parent 8873dc1 commit da48fdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Classes/Fusion/XmlSitemapUrlsImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public function evaluate(): array
$startingPoint = $this->getStartingPoint();
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($startingPoint);

$nodeTypeManager = $this->contentRepositoryRegistry->get($startingPoint->subgraphIdentity->contentRepositoryId)->getNodeTypeManager();
$nodeTypeManager = $this->contentRepositoryRegistry->get($startingPoint->contentRepositoryId)->getNodeTypeManager();
$nodeTypeNames = NodeTypeNames::fromArray(array_map(
fn(NodeType $nodeType): NodeTypeName => $nodeType->name,
$nodeTypeManager->getSubNodeTypes('Neos.Neos:Document', false)
));

$subtree = $subgraph->findSubtree(
$startingPoint->nodeAggregateId,
$startingPoint->aggregateId,
FindSubtreeFilter::create(nodeTypes: NodeTypeCriteria::create($nodeTypeNames, NodeTypeNames::createEmpty()))
);

Expand Down Expand Up @@ -156,7 +156,7 @@ protected function collectItems(array &$items, Subtree $subtree): void
}

if ($this->getIncludeImageUrls()) {
$nodeTypeManager = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId)->getNodeTypeManager();
$nodeTypeManager = $this->contentRepositoryRegistry->get($node->contentRepositoryId)->getNodeTypeManager();
$collectionNodeTypeNames = array_map(
fn(NodeType $nodeType): NodeTypeName => $nodeType->name,
$nodeTypeManager->getSubNodeTypes('Neos.Neos:ContentCollection', false)
Expand All @@ -170,7 +170,7 @@ protected function collectItems(array &$items, Subtree $subtree): void

$subgraph = $this->contentRepositoryRegistry->subgraphForNode($node);
$contentSubtree = $subgraph->findSubtree(
$node->nodeAggregateId,
$node->aggregateId,
FindSubtreeFilter::create(nodeTypes: NodeTypeCriteria::create($nodeTypeNames, NodeTypeNames::createEmpty()))
);

Expand Down Expand Up @@ -224,7 +224,7 @@ protected function isDocumentNodeToBeIndexed(Node $node): bool
&& $node->getProperty('metaRobotsNoindex') !== true
&& (
(string)$node->getProperty('canonicalLink') === ''
|| substr($node->getProperty('canonicalLink'), 7) === $node->nodeAggregateId->value
|| substr($node->getProperty('canonicalLink'), 7) === $node->aggregateId->value
);
}
}
7 changes: 3 additions & 4 deletions Configuration/Routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
'node':
handler: 'Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface'
options:
uriPathSuffix: ''
onlyMatchSiteNodes: true
appendExceedingArguments: true


-
name: 'XML Sitemap'
Expand All @@ -30,8 +29,8 @@
'node':
handler: 'Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface'
options:
uriPathSuffix: ''
onlyMatchSiteNodes: true
appendExceedingArguments: true

-
name: 'robots.txt'
Expand All @@ -45,5 +44,5 @@
'node':
handler: 'Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface'
options:
uriPathSuffix: ''
onlyMatchSiteNodes: true
appendExceedingArguments: true

0 comments on commit da48fdc

Please sign in to comment.