diff --git a/core/modules/content_translation/src/Plugin/migrate/source/d6/BlockTranslation.php b/core/modules/content_translation/src/Plugin/migrate/source/d6/BlockTranslation.php index f387b46de1..03e30f2fb8 100644 --- a/core/modules/content_translation/src/Plugin/migrate/source/d6/BlockTranslation.php +++ b/core/modules/content_translation/src/Plugin/migrate/source/d6/BlockTranslation.php @@ -27,7 +27,7 @@ public function query() { ->fields('b', ['bid', 'module', 'delta', 'theme', 'title']); $query->addField('b', 'module', 'block_module'); $query->addField('b', 'delta', 'block_delta'); - $query->leftJoin($this->blockTable, 'b', ('b.module = i18n.module AND b.delta = i18n.delta')); + $query->innerJoin($this->blockTable, 'b', ('b.module = i18n.module AND b.delta = i18n.delta')); return $query; } diff --git a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php index 2612d928a8..99c898d871 100644 --- a/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php +++ b/core/modules/content_translation/tests/src/Kernel/Migrate/d6/MigrateBlockContentTranslationTest.php @@ -53,8 +53,14 @@ protected function setUp() { * Tests the migration of block title translation. */ public function testBlockContentTranslation() { - $config = $this->container->get('language_manager')->getLanguageConfigOverride('zu', 'block.block.user_1'); + /** @var \Drupal\Core\language\LanguageManager $language_manager */ + $language_manager = $this->container->get('language_manager'); + + $config = $language_manager->getLanguageConfigOverride('zu', 'block.block.user_1'); $this->assertSame('zu - Test Title 02', $config->get('settings.label')); + + $config = $language_manager->getLanguageConfigOverride('fr', 'block.block.menu_1'); + $this->assertSame('fr - Secondary links title', $config->get('settings.label')); } } diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 7cbd9a385a..52a8bce3f8 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -920,7 +920,7 @@ 'delta' => 'feed-5', 'theme' => 'garland', 'status' => '1', - 'weight' => '-2', + 'weight' => '-8', 'region' => 'right', 'custom' => '0', 'throttle' => '0', @@ -1010,7 +1010,7 @@ 'delta' => '0', 'theme' => 'garland', 'status' => '1', - 'weight' => '-4', + 'weight' => '-9', 'region' => 'right', 'custom' => '0', 'throttle' => '0', @@ -1070,7 +1070,7 @@ 'delta' => '0', 'theme' => 'garland', 'status' => '1', - 'weight' => '0', + 'weight' => '-7', 'region' => 'right', 'custom' => '0', 'throttle' => '0', @@ -1079,6 +1079,21 @@ 'title' => '', 'cache' => '-1', )) +->values(array( + 'bid' => '27', + 'module' => 'menu', + 'delta' => 'menu-fr-secondary-links', + 'theme' => 'garland', + 'status' => '1', + 'weight' => '0', + 'region' => 'right', + 'custom' => '0', + 'throttle' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => 'fr - Secondary links title', + 'cache' => '-1', +)) ->execute(); $connection->schema()->createTable('blocks_roles', array( @@ -8545,6 +8560,27 @@ 'type' => '0', 'language' => 'zu', )) +->values(array( + 'ibid' => '2', + 'module' => 'block', + 'delta' => '3', + 'type' => '0', + 'language' => 'fr', +)) +->values(array( + 'ibid' => '3', + 'module' => 'menu', + 'delta' => 'secondary-links', + 'type' => '0', + 'language' => 'en', +)) +->values(array( + 'ibid' => '4', + 'module' => 'menu', + 'delta' => 'menu-fr-secondary-links', + 'type' => '0', + 'language' => 'fr', +)) ->execute(); $connection->schema()->createTable('i18n_strings', array( @@ -8778,22 +8814,6 @@ 'format' => '2', )) ->values(array( - 'lid' => '526', - 'objectid' => '2', - 'type' => 'block', - 'property' => 'title', - 'objectindex' => '2', - 'format' => '0', -)) -->values(array( - 'lid' => '527', - 'objectid' => '2', - 'type' => 'block', - 'property' => 'body', - 'objectindex' => '2', - 'format' => '2', -)) -->values(array( 'lid' => '528', 'objectid' => '4', 'type' => 'vocabulary', @@ -9657,6 +9677,30 @@ 'objectindex' => '7', 'format' => '0', )) +->values(array( + 'lid' => '1674', + 'objectid' => 'menu-fr-secondary-links', + 'type' => 'menu', + 'property' => 'title', + 'objectindex' => '0', + 'format' => '0', +)) +->values(array( + 'lid' => '1677', + 'objectid' => '462', + 'type' => 'item', + 'property' => 'title', + 'objectindex' => '462', + 'format' => '0', +)) +->values(array( + 'lid' => '1678', + 'objectid' => '462', + 'type' => 'item', + 'property' => 'description', + 'objectindex' => '462', + 'format' => '0', +)) ->execute(); $connection->schema()->createTable('i18n_variable', array( @@ -14095,20 +14139,6 @@ 'version' => '1', )) ->values(array( - 'lid' => '526', - 'location' => 'block:2:title', - 'textgroup' => 'blocks', - 'source' => 'Another Static Block', - 'version' => '1', -)) -->values(array( - 'lid' => '527', - 'location' => 'block:2:body', - 'textgroup' => 'blocks', - 'source' => '