diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeTranslationLookup.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeTranslationLookup.php index 9722273af16973175c2ac21f85d7c68715e88960..36b193eb28e8c9f9558d575b99e558d1162ebd67 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeTranslationLookup.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeTranslationLookup.php @@ -30,6 +30,10 @@ class NodeCompleteNodeTranslationLookup extends ProcessPluginBase { */ public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { if (is_array($value) && count($value) === 3) { + // If the language is 'und' then the node was not translated. + if ($value[2] === 'und') { + return NULL; + } unset($value[1]); return array_values($value); } diff --git a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php index d79eaf26c94b1d69e0b5bc3a0724d72de92ad2ba..5515e9c9de0074d3bda03b402e3dc071de219f13 100644 --- a/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php +++ b/core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php @@ -43,9 +43,6 @@ protected function setUp(): void { $this->executeMigrations([ 'language', 'd6_node_settings', - 'd6_node', - 'd6_node_translation', - 'd6_url_alias', ]); } @@ -72,6 +69,29 @@ private function assertPath(int $pid, array $conditions, PathAliasInterface $pat * Tests the URL alias migration. */ public function testUrlAlias() { + $this->executeMigrations([ + 'd6_node', + 'd6_node_translation', + 'd6_url_alias', + ]); + $this->checkUrlMigration(); + } + + /** + * Tests the URL alias migration using the node complete migration. + */ + public function testNodeCompleteUrlAlias() { + $this->executeMigrations([ + 'd6_node_complete', + 'd6_url_alias', + ]); + $this->checkUrlMigration(); + } + + /** + * Checks the migration results. + */ + protected function checkUrlMigration() { $id_map = $this->getMigration('d6_url_alias')->getIdMap(); // Test that the field exists. $conditions = [