diff --git a/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module index d31feed..49b5be9 100644 --- a/core/modules/migrate_drupal/migrate_drupal.module +++ b/core/modules/migrate_drupal/migrate_drupal.module @@ -5,11 +5,13 @@ * Provides migration from other Drupal sites. */ +use Drupal\Core\Database\DatabaseExceptionWrapper; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\MigrateExecutable; use Drupal\migrate\MigrateMessage; use Drupal\migrate\Plugin\Migration; +use Drupal\migrate\Plugin\RequirementsInterface; /** * Implements hook_help(). @@ -44,10 +46,13 @@ function migrate_drupal_migration_plugins_alter(&$definitions) { $vocabulary_migration = new Migration([], uniqid(), $vocabulary_migration_definition); try { - $vocabulary_migration->checkRequirements(); + $source_plugin = $vocabulary_migration->getSourcePlugin(); + if ($source_plugin instanceof RequirementsInterface) { + $source_plugin->checkRequirements(); + } $executable = new MigrateExecutable($vocabulary_migration, new MigrateMessage()); $process = ['vid' => $definitions['d6_taxonomy_vocabulary']['process']['vid']]; - foreach ($vocabulary_migration->getSourcePlugin() as $row) { + foreach ($source_plugin as $row) { $executable->processRow($row, $process); $source_vid = $row->getSourceProperty('vid'); $plugin_ids = ['d6_term_node:' . $source_vid, 'd6_term_node_revision:' . $source_vid]; @@ -63,6 +68,10 @@ function migrate_drupal_migration_plugins_alter(&$definitions) { // if you have a Drupal 7 source site then the requirements will not be // met for the d6_taxonomy_vocabulary migration. } + catch (DatabaseExceptionWrapper $e) { + // When the definitions are loaded it is possible the tables will not + // exist. + } } }