From b4e533de8aa12e41e6a80955ed31035daf2f6307 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 19:32:24 +0200 Subject: [PATCH] Tweak event migration --- .../Classes/Service/EventMigrationService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index 41583dc5acb..f865d275860 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -21,6 +21,7 @@ use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions; use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\Command\MigrateEventsCommandController; use Neos\ContentRepositoryRegistry\Factory\EventStore\DoctrineEventStoreFactory; use Neos\EventStore\EventStoreInterface; @@ -350,7 +351,11 @@ public function migratePayloadToWorkspaceName(\Closure $outputFn): void continue; } $eventData = self::decodeEventPayload($eventEnvelope); - $this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceNamesByContentStreamId[$eventData['contentStreamId']]]); + $workspaceName = $workspaceNamesByContentStreamId[$eventData['contentStreamId']] ?? null; + if ($workspaceName === null) { + $workspaceName = WorkspaceName::fromString('missing'); + } + $this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceName]); $numberOfMigratedEvents++; } if ($numberOfMigratedEvents === 0) {