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' => '

My second custom block body

', - 'version' => '1', -)) -->values(array( 'lid' => '528', 'location' => 'vocabulary:4:name', 'textgroup' => 'taxonomy', @@ -22123,6 +22153,27 @@ 'source' => 'Forums', 'version' => '1', )) +->values(array( + 'lid' => '1674', + 'location' => 'menu:menu-fr-secondary-links:title', + 'textgroup' => 'menu', + 'source' => 'fr - Secondary links', + 'version' => '1', +)) +->values(array( + 'lid' => '1677', + 'location' => 'item:462:title', + 'textgroup' => 'menu', + 'source' => 'fr -Test 2', + 'version' => '1', +)) +->values(array( + 'lid' => '1678', + 'location' => 'item:462:description', + 'textgroup' => 'menu', + 'source' => 'fr Test menu link 2', + 'version' => '1', +)) ->execute(); $connection->schema()->createTable('locales_target', array( @@ -26344,22 +26395,6 @@ 'i18n_status' => '0', )) ->values(array( - 'lid' => '526', - 'translation' => 'Encore un bloc statique', - 'language' => 'fr', - 'plid' => '0', - 'plural' => '0', - 'i18n_status' => '0', -)) -->values(array( - 'lid' => '527', - 'translation' => 'Nom de vocabulaire beaucoup plus long que trente-deux caractères', - 'language' => 'fr', - 'plid' => '0', - 'plural' => '0', - 'i18n_status' => '0', -)) -->values(array( 'lid' => '528', 'translation' => 'fr - Tags', 'language' => 'fr', @@ -27298,6 +27333,11 @@ 'description', )) ->values(array( + 'menu_name' => 'menu-fr-secondary-links', + 'title' => 'fr - Secondary links', + 'description' => '', +)) +->values(array( 'menu_name' => 'navigation', 'title' => 'Navigation', 'description' => 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.', @@ -29033,7 +29073,7 @@ 'module' => 'system', 'hidden' => '0', 'external' => '0', - 'has_children' => '0', + 'has_children' => '1', 'expanded' => '0', 'weight' => '0', 'depth' => '3', @@ -33666,6 +33706,60 @@ 'p9' => '0', 'updated' => '0', )) +->values(array( + 'menu_name' => 'navigation', + 'mlid' => '461', + 'plid' => '197', + 'link_path' => 'admin/build/menu-customize/menu-fr-secondary-links', + 'router_path' => 'admin/build/menu-customize/%', + 'link_title' => 'fr - Secondary links', + 'options' => 'a:1:{s:5:"alter";b:1;}', + 'module' => 'menu', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '4', + 'customized' => '0', + 'p1' => '144', + 'p2' => '166', + 'p3' => '197', + 'p4' => '461', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', +)) +->values(array( + 'menu_name' => 'menu-fr-secondary-links', + 'mlid' => '462', + 'plid' => '0', + 'link_path' => 'admin', + 'router_path' => 'admin', + 'link_title' => 'fr -Test 2', + 'options' => 'a:3:{s:5:"query";s:7:"foo=bar";s:10:"attributes";a:1:{s:5:"title";s:19:"fr Test menu link 2";}s:8:"langcode";s:2:"fr";}', + 'module' => 'menu', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '1', + 'customized' => '1', + 'p1' => '462', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', +)) ->execute(); $connection->schema()->createTable('menu_router', array(