Skip to content

Commit

Permalink
fix: prevent exception during migration step
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Frantzen committed Aug 22, 2024
1 parent 7b40fb2 commit e7b06ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Resources/phpcr-migrations/Version202407111600.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private function upgrade(SessionInterface $session): void
/** @var Row<mixed> $row */
foreach ($rows as $row) {
$node = $row->getNode();
if (!$node->hasProperty($templateKey)) {
continue;
}
$structureType = $node->getPropertyValue($templateKey);
$routePathPropertyName = $this->getRoutePathPropertyName($structureType, $locale);

Expand All @@ -114,6 +117,9 @@ private function downgrade(SessionInterface $session)
foreach ($rows as $row) {
$node = $row->getNode();
$propertyName = $this->propertyEncoder->localizedContentName(RoutableSubscriber::ROUTE_FIELD_NAME, $locale);
if (!$node->hasProperty($propertyName)) {
continue;
}
$node->setProperty($propertyName, null);
}
}
Expand Down

0 comments on commit e7b06ff

Please sign in to comment.