fix: skip entity types whose module is not installed during import

Prevents 500 error when importing a backup that contains entities
(e.g. SignatureRequest) from modules not installed on the target instance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 20:01:20 +00:00
parent 838ef5c2c6
commit eed25a87b2
@@ -100,6 +100,11 @@ class ImportService
continue;
}
if (!$this->entityTypeExists($entityType)) {
$io->writeLine("Skipping {$entityType} (module not installed)");
continue;
}
$io->writeLine("Importing {$entityType}...");
$result = $this->entityImporter->import(
@@ -171,4 +176,14 @@ class ImportService
}
}
}
private function entityTypeExists(string $entityType): bool
{
try {
$this->entityManager->getRDBRepository($entityType);
return true;
} catch (\Exception $e) {
return false;
}
}
}