diff -u b/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module --- b/core/modules/migrate_drupal/migrate_drupal.module +++ b/core/modules/migrate_drupal/migrate_drupal.module @@ -96,15 +96,17 @@ // instances of migration_lookup in core migrations to use dN_node_master. if (_isMultilingualSource($definitions)) { foreach ($definitions as &$definition) { - $properties = ['process', 'destination', 'migration_dependencies']; - foreach ($properties as $property) { - if (isset($definition[$property])) { - array_walk_recursive($definition[$property], function (&$value) { - if (is_string($value)) { - $value = preg_replace('/d([67])_(node|node_translation|node_revision)($|:.*)/', 'd$1_node_master$3', $value); - } - return $value; - }); + if (!preg_match('/d([67])_(node|node_translation|node_revision)($|:.*)/', $definition['id'])) { + $properties = ['process', 'destination', 'migration_dependencies']; + foreach ($properties as $property) { + if (isset($definition[$property])) { + array_walk_recursive($definition[$property], function (&$value) { + if (is_string($value)) { + $value = preg_replace('/d([67])_(node|node_translation|node_revision)($|:.*)/', 'd$1_node_master$3', $value); + } + return $value; + }); + } } } } @@ -163,23 +165,25 @@ */ - function _isMultilingualSource($definitions) { - /** @var \Drupal\migrate\Plugin\migrate\source\SqlBase $source_plugin */ - $source_plugin = \Drupal::service('plugin.manager.migration') - ->createStubMigration($definitions['system_site']) - ->getSourcePlugin(); - $connection = NULL; - try { - $connection = $source_plugin->getDatabase(); - } - catch (\Exception $e) { - // @todo: do something useful. - } - $status = FALSE; - if ($connection) { - // Connect to source database. - $status = $connection->query("SELECT status FROM {system} WHERE name = :name and type = :type", [ - ':name' => 'i18n', - ':type' => 'module', - ])->fetchField(); - } - return ($status === '1') ? TRUE : FALSE; +function _isMultilingualSource($definitions) { + /** @var \Drupal\migrate\Plugin\migrate\source\SqlBase $source_plugin */ + $source_plugin = \Drupal::service('plugin.manager.migration') + ->createStubMigration($definitions['system_site']) + ->getSourcePlugin(); + $connection = NULL; + try { + $connection = $source_plugin->getDatabase(); + } + catch (\Exception $e) { + // @todo: do something useful. + } + $status = FALSE; + if ($connection) { + if ($connection->schema()->tableExists('system')) { + // Connect to source database. + $status = $connection->query("SELECT status FROM {system} WHERE name = :name and type = :type", [ + ':name' => 'i18n', + ':type' => 'module', + ])->fetchField(); + } + } + return ($status === '1') ? TRUE : FALSE; }