From a5f59c4a0cf719ebb7c4081a2925300677b716f2 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:50:55 +0100 Subject: [PATCH] TASK: Fix exception in reorderNodeAggregateWasRemoved publish does not work for 0 events --- .../Classes/Service/EventMigrationService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index 1e7364dcee..34a23dc5fc 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -774,6 +774,11 @@ public function reorderNodeAggregateWasRemoved(\Closure $outputFn): void // get all NodeAggregateWasRemoved from the live content stream $eventsToReorder = iterator_to_array($this->eventStore->load($liveContentStreamName, EventStreamFilter::create(EventTypes::create(EventType::fromString('NodeAggregateWasRemoved')))), false); + if (!count($eventsToReorder)) { + $outputFn('Migration was not necessary.'); + return; + } + // remove all the NodeAggregateWasRemoved events at their sequenceNumbers $eventTableName = DoctrineEventStoreFactory::databaseTableName($this->contentRepositoryId); $this->connection->beginTransaction();