Skip to content

Commit

Permalink
BUGFIX: Rewrite fusion node.identifier properly to node.aggregateId
Browse files Browse the repository at this point in the history
  • Loading branch information
dlubitz committed Dec 18, 2024
1 parent 6466cd8 commit f753ce3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/set/contentrepository-90.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
\Neos\ContentRepository\Domain\NodeType\NodeTypeName::class => \Neos\ContentRepository\Core\NodeType\NodeTypeName::class,
\Neos\ContentRepository\Domain\Projection\Content\PropertyCollectionInterface::class => \Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection::class,
\Neos\ContentRepository\Domain\Model\ArrayPropertyCollection::class => \Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection::class,
\Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface::class => \Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface::class,
]);

$rectorConfig->ruleWithConfiguration(FusionReplacePrototypeNameRector::class, [
Expand Down
9 changes: 7 additions & 2 deletions src/ContentRepository90/Rules/YamlRoutePartHandlerRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ public function refactorFileContent(string $fileContent): string
continue;
}

$handlerToReplace = [
\Neos\Neos\Routing\FrontendNodeRoutePartHandler::class,
\Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface::class,
];

foreach ($routeConfig['routeParts'] as $routePartKey => $routePart) {
if (isset($routePart['handler']) && $routePart['handler'] === 'Neos\Neos\Routing\FrontendNodeRoutePartHandler') {
$parsed[$routeConfigKey]['routeParts'][$routePartKey]['handler'] = 'Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface';
if (isset($routePart['handler']) && in_array($routePart['handler'], $handlerToReplace)) {
$parsed[$routeConfigKey]['routeParts'][$routePartKey]['handler'] = \Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface::class;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
uriPattern: '{node}'
routeParts:
node:
handler: Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface
handler: Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface
options:
uriPathSuffix: '<defaultUriSuffix>'
appendExceedingArguments: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Neos\Rector\Test;

use Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface;

class SomeClass implements FrontendNodeRoutePartHandlerInterface
{

}

-----
<?php

namespace Neos\Rector\Test;

use Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface;

class SomeClass implements \Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface
{

}

0 comments on commit f753ce3

Please sign in to comment.