diff --git a/Resources/phpcr-migrations/Version202407111600.php b/Resources/phpcr-migrations/Version202407111600.php index 1d996f34..20aaf1ad 100644 --- a/Resources/phpcr-migrations/Version202407111600.php +++ b/Resources/phpcr-migrations/Version202407111600.php @@ -89,6 +89,9 @@ private function upgrade(SessionInterface $session): void /** @var Row $row */ foreach ($rows as $row) { $node = $row->getNode(); + if (!$node->hasProperty($templateKey)) { + continue; + } $structureType = $node->getPropertyValue($templateKey); $routePathPropertyName = $this->getRoutePathPropertyName($structureType, $locale); @@ -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); } }