Skip to content

Commit 4cefcae

Browse files
adrian-cerdeirat-heuser
authored andcommitted
fix: property value migration and add into settings custom transformation
1 parent cb633dd commit 4cefcae

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Classes/Migration/Transformation/PropertyValueToLowercase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Flowpack\SeoRouting\Migration\Transformation;
66

7-
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
7+
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
88
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
99
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
1010
use Neos\ContentRepository\NodeMigration\Transformation\NodeBasedTransformationInterface;
@@ -36,12 +36,12 @@ public function __construct(string $propertyName)
3636
$this->propertyName = $propertyName;
3737
}
3838

39-
public function execute(Node $node, DimensionSpacePoint $coveredDimensionSpacePoints, WorkspaceName $workspaceNameForWriting): TransformationStep
40-
{
39+
public function execute(Node $node, DimensionSpacePointSet $coveredDimensionSpacePoints, WorkspaceName $workspaceNameForWriting): TransformationStep {
4140
$currentProperty = $node->getProperty($this->propertyName);
4241

4342
if ($currentProperty !== null && is_string($currentProperty)) {
4443
$value = strtolower($currentProperty);
44+
4545
return TransformationStep::fromCommand(
4646
SetNodeProperties::create(
4747
$workspaceNameForWriting,

Configuration/Settings.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ Neos:
1515
middlewares:
1616
'after routing':
1717
middleware: 'Flowpack\SeoRouting\RoutingMiddleware'
18+
19+
ContentRepositoryRegistry:
20+
nodeMigration:
21+
transformationFactories:
22+
PropertyValueToLowercase: Flowpack\SeoRouting\Migration\Transformation\PropertyValueToLowercase

Migrations/ContentRepository/Version20250124153030.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ migration:
66
settings:
77
nodeType: "Neos.Neos:Document"
88
withSubTypes: TRUE
9-
# Custom transformation not possible in Neos < 9.0: https://neos-project.slack.com/archives/C04V4C6B0/p1752678184783919
10-
# transformations:
11-
# - type: 'Flowpack\SeoRouting\Migration\Transformation\PropertyValueToLowercase'
12-
# settings:
13-
# property: "uriPathSegment"
9+
transformations:
10+
- type: 'PropertyValueToLowercase'
11+
settings:
12+
property: "uriPathSegment"

0 commit comments

Comments
 (0)