diff --git a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php index e9861f80ef..674d87d84d 100644 --- a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php +++ b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php @@ -138,10 +138,6 @@ protected function getMigrations($database_state_key, $drupal_version) { case NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC: $patterns = '/(d' . $drupal_version . '_node_master:)/'; break; - - case NodeMigrateType::NODE_MIGRATE_TYPE_BOTH: - $patterns = '//'; - break; } foreach ($all_migrations as $key => $migrations) { if (preg_match($patterns, $key)) { @@ -317,19 +313,18 @@ protected function getState() { */ protected function getNodeMigrateType(array $migrations, $version) { $migrate_type = NodeMigrateType::NODE_MIGRATE_TYPE_MASTER; + // Create the variable name, 'node_has_rows' or 'node_master_exists' and + // set it the default value, FALSE. $node_has_rows = FALSE; $node_master_has_rows = FALSE; $ids = ['node_master', 'node']; foreach ($ids as $id) { - // Create the variable name, 'node_exists' or 'node_master_exists' and - // set it to the default value, FALSE. $has_rows = $id . '_has_rows'; - $$has_rows = FALSE; $patterns = '/d' . $version . '_' . $id . ':/'; $matches = preg_grep($patterns, array_keys($migrations)); - // When the migration has a map table set 'node_exists' or - // 'node_master_exists' to TRUE. + // Set the has_rows True when a map table has rows with a positive + // count for the matched migration. foreach ($matches as $match) { $count = $migrations[$match]->getIdMap()->processedCount(); if ($count > 0) { @@ -340,9 +335,6 @@ protected function getNodeMigrateType(array $migrations, $version) { } // Set the node migration type to use. - if ($node_has_rows && $node_master_has_rows) { - $migrate_type = NodeMigrateType::NODE_MIGRATE_TYPE_BOTH; - } if ($node_has_rows && !$node_master_has_rows) { $migrate_type = NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC; } diff --git a/core/modules/migrate_drupal/src/NodeMigrateType.php b/core/modules/migrate_drupal/src/NodeMigrateType.php index 2086364f03..a037f98d5b 100644 --- a/core/modules/migrate_drupal/src/NodeMigrateType.php +++ b/core/modules/migrate_drupal/src/NodeMigrateType.php @@ -19,11 +19,6 @@ final class NodeMigrateType { */ const NODE_MIGRATE_TYPE_CLASSIC = 'CLASSIC'; - /** - * Both the classic and master node migration map tables are in use. - */ - const NODE_MIGRATE_TYPE_BOTH = 'BOTH'; - /** * Determines the type of node migration to be used. * @@ -65,7 +60,7 @@ public function getNodeMigrateType(array $definitions) { catch (\Exception $e) { // @todo: do something useful. } - $version_string = FALSE; + $version = FALSE; if ($connection) { $version = $this->getLegacyDrupalVersion($connection); @@ -87,6 +82,8 @@ public function getNodeMigrateType(array $definitions) { protected function migrateType($version) { $migrate_type = static::NODE_MIGRATE_TYPE_MASTER; if ($version) { + // Create the variable name, 'node_has_rows' or 'node_master_exists' and + // set it the default value, FALSE. $node_has_rows = FALSE; $node_master_has_rows = FALSE; $connection = \Drupal::database(); @@ -100,13 +97,10 @@ protected function migrateType($version) { $tables = $connection->schema() ->findTables('migrate_map_d' . $version . '_node%'); foreach ($bases as $base) { - // Create the variable name, 'node_exists' or 'node_master_exists' and - // set it the default value, FALSE. $has_rows = $base . '_has_rows'; - $$has_rows = FALSE; $base_tables = preg_grep('/^migrate_map_d' . $version . '_' . $base . '_{2}.*$/', $tables); - // Set the existence flag True when a map table exists for the matched - // migration. + // Set the has_rows True when a map table has rows with a positive + // count for the matched migration. foreach ($base_tables as $base_table) { if ($connection->schema()->tableExists($base_table)) { $count = $connection->select($base_table)->countQuery() @@ -120,9 +114,6 @@ protected function migrateType($version) { } // Set the node migration type to use. - if ($node_has_rows && $node_master_has_rows) { - $migrate_type = static::NODE_MIGRATE_TYPE_BOTH; - } if ($node_has_rows && !$node_master_has_rows) { $migrate_type = static::NODE_MIGRATE_TYPE_CLASSIC; }