diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index 9da4be1a291..c4ba07641e8 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -34,7 +34,6 @@ use Neos\Neos\Domain\Model\WorkspaceClassification; use Neos\Neos\Domain\Model\WorkspaceRole; use Neos\Neos\Domain\Model\WorkspaceSubjectType; -use Neos\Neos\Domain\Service\WorkspaceService; /** * Content Repository service to perform migrations of events. @@ -52,8 +51,7 @@ final class EventMigrationService implements ContentRepositoryServiceInterface public function __construct( private readonly ContentRepositoryId $contentRepositoryId, private readonly EventStoreInterface $eventStore, - private readonly Connection $connection, - private readonly WorkspaceService $workspaceService, + private readonly Connection $connection ) { } @@ -585,12 +583,19 @@ public function migrateWorkspaceMetadataToWorkspaceService(\Closure $outputFn): $isPersonalWorkspace = str_starts_with($workspaceName->value, 'user-'); $isPrivateWorkspace = $workspaceOwner !== null && !$isPersonalWorkspace; $isInternalWorkspace = $baseWorkspaceName !== null && $workspaceOwner === null; - try { - $this->workspaceService->getWorkspaceMetadata($this->contentRepositoryId, $workspaceName); + + $query = <<connection->fetchOne($query, [ + 'contentRepositoryId' => $this->contentRepositoryId->value, + 'workspaceName' => $workspaceName->value, + ]); + if ($metadataExists !== 0) { $outputFn(sprintf('Metadata for "%s" exists already.', $workspaceName->value)); continue; - } catch (\Exception $e) { - // metadata does not exist yet } if ($baseWorkspaceName === null) { $classification = WorkspaceClassification::ROOT; diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationServiceFactory.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationServiceFactory.php index ca89e22c688..f61935dccaa 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationServiceFactory.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationServiceFactory.php @@ -10,7 +10,6 @@ use Neos\ContentRepositoryRegistry\Command\MigrateEventsCommandController; use Neos\EventStore\DoctrineAdapter\DoctrineEventStore; use Neos\Flow\Annotations as Flow; -use Neos\Neos\Domain\Service\WorkspaceService; /** * Factory for the {@see EventMigrationService} @@ -22,8 +21,7 @@ final class EventMigrationServiceFactory implements ContentRepositoryServiceFactoryInterface { public function __construct( - private readonly Connection $connection, - private readonly WorkspaceService $workspaceService + private readonly Connection $connection ) { } @@ -36,8 +34,7 @@ public function build(ContentRepositoryServiceFactoryDependencies $serviceFactor return new EventMigrationService( $serviceFactoryDependencies->contentRepositoryId, $serviceFactoryDependencies->eventStore, - $this->connection, - $this->workspaceService, + $this->connection ); } }