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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user