diff --git a/core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php b/core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php new file mode 100644 index 0000000000000000000000000000000000000000..acf9e2b7c8ae544b9ef8fc2e230ea66ccd8c0515 --- /dev/null +++ b/core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php @@ -0,0 +1,99 @@ +select('i18n_string', 'i18n') + ->fields('i18n') + ->fields('b', [ + 'bid', + 'module', + 'delta', + 'theme', + 'status', + 'weight', + 'region', + 'custom', + 'visibility', + 'pages', + 'title', + 'cache', + 'i18n_mode', + ]) + ->fields('lt', [ + 'lid', + 'translation', + 'language', + 'plid', + 'plural', + 'i18n_status', + ]) + ->condition('i18n_mode', 1); + $query->leftjoin($this->blockTable, 'b', ('b.delta = i18n.objectid')); + $query->leftjoin('locales_target', 'lt', 'lt.lid = i18n.lid'); + return $query; + } + + /** + * {@inheritdoc} + */ + public function fields() { + return [ + 'bid' => $this->t('The block numeric identifier.'), + 'module' => $this->t('The module providing the block.'), + 'delta' => $this->t("The block's delta."), + 'theme' => $this->t('Which theme the block is placed in.'), + 'status' => $this->t('Block enabled status'), + 'weight' => $this->t('Block weight within region'), + 'region' => $this->t('Theme region within which the block is set'), + 'visibility' => $this->t('Visibility'), + 'pages' => $this->t('Pages list.'), + 'title' => $this->t('Block title.'), + 'cache' => $this->t('Cache rule.'), + 'i18n_mode' => $this->t('Multilingual mode'), + 'lid' => $this->t('Language string ID'), + 'textgroup' => $this->t('A module defined group of translations'), + 'context' => $this->t('Full string ID for quick search: type:objectid:property.'), + 'objectid' => $this->t('Object ID'), + 'type' => $this->t('Object type for this string'), + 'property' => $this->t('Object property for this string'), + 'objectindex' => $this->t('Integer value of Object ID'), + 'format' => $this->t('The {filter_format}.format of the string'), + 'translation' => $this->t('Translation'), + 'language' => $this->t('Language code'), + 'plid' => $this->t('Parent lid'), + 'plural' => $this->t('Plural index number'), + 'i18n_status' => $this->t('Translation needs update'), + ]; + } + + /** + * {@inheritdoc} + */ + public function getIds() { + $ids['delta']['type'] = 'string'; + $ids['delta']['alias'] = 'b'; + $ids['language']['type'] = 'string'; + return $ids; + } + +} diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0d082a8e06f255004e48760bd4bbd50d4c3d730f --- /dev/null +++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php @@ -0,0 +1,69 @@ +installConfig(['block']); + $this->installConfig(['block_content']); + $this->installEntitySchema('block_content'); + + $this->executeMigrations([ + 'language', + 'd7_filter_format', + 'block_content_type', + 'block_content_body_field', + 'd7_custom_block', + 'd7_user_role', + 'd7_block', + 'd7_block_translation', + ]); + block_rebuild(); + } + + /** + * Tests the migration of block title translation. + */ + public function testBlockContentTranslation() { + /** @var \Drupal\language\ConfigurableLanguageManagerInterface $language_manager */ + $language_manager = $this->container->get('language_manager'); + + $config = $language_manager->getLanguageConfigOverride('fr', 'block.block.bartik_user_login'); + $this->assertSame('fr - User login title', $config->get('settings.label')); + } + +} diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php index 6f07dc9c21e7bc38f865e94d2b2ba48574f2e9ff..d56b9ed19625ff0173bbbf200a93abd46cbdd07e 100644 --- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php +++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php @@ -112,10 +112,10 @@ public function assertEntity($id, $plugin_id, array $roles, $pages, $region, $th public function testBlockMigration() { $this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'bartik', 0, '', '0'); $this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'sidebar_first', 'bartik', -1, '', '0'); - $this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'sidebar_first', 'bartik', 0, '', '0'); + $this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'sidebar_first', 'bartik', 0, 'User login title', 'visible'); $this->assertEntity('bartik_system_powered_by', 'system_powered_by_block', [], '', 'footer_fifth', 'bartik', 10, '', '0'); $this->assertEntity('seven_system_main', 'system_main_block', [], '', 'content', 'seven', 0, '', '0'); - $this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'seven', 10, '', '0'); + $this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'seven', 10, 'User login title', 'visible'); // The d7_custom_block migration should have migrated a block containing a // mildly amusing limerick. We'll need its UUID to determine diff --git a/core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php b/core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php new file mode 100644 index 0000000000000000000000000000000000000000..01b2dced662c266ef0b5b141da6497aaf2cbc616 --- /dev/null +++ b/core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php @@ -0,0 +1,147 @@ + 1, + 'module' => 'system', + 'delta' => 'main', + 'theme' => 'bartik', + 'status' => 1, + 'weight' => 0, + 'region' => 'content', + 'custom' => '0', + 'visibility' => 0, + 'pages' => '', + 'title' => '', + 'cache' => -1, + 'i18n_mode' => 0, + ], + [ + 'bid' => 2, + 'module' => 'system', + 'delta' => 'navigation', + 'theme' => 'bartik', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'custom' => '0', + 'visibility' => 0, + 'pages' => '', + 'title' => 'Navigation', + 'cache' => -1, + 'i18n_mode' => 1, + ], + ]; + $tests[0]['source_data']['block_role'] = [ + [ + 'module' => 'block', + 'delta' => 1, + 'rid' => 2, + ], + [ + 'module' => 'block', + 'delta' => 2, + 'rid' => 2, + ], + [ + 'module' => 'block', + 'delta' => 2, + 'rid' => 100, + ], + ]; + $tests[0]['source_data']['i18n_string'] = [ + [ + 'lid' => 1, + 'textgroup' => 'block', + 'context' => '1', + 'objectid' => 'navigation', + 'type' => 'system', + 'property' => 'title', + 'objectindex' => 0, + 'format' => '', + ], + ]; + + $tests[0]['source_data']['locales_target'] = [ + [ + 'lid' => 1, + 'translation' => 'fr - Navigation', + 'language' => 'fr', + 'plid' => 0, + 'plural' => 0, + 'i18n_status' => 0, + ], + ]; + $tests[0]['source_data']['role'] = [ + [ + 'rid' => 2, + 'name' => 'authenticated user', + ], + ]; + $tests[0]['source_data']['system'] = [ + [ + 'filename' => 'modules/system/system.module', + 'name' => 'system', + 'type' => 'module', + 'owner' => '', + 'status' => '1', + 'throttle' => '0', + 'bootstrap' => '0', + 'schema_version' => '7055', + 'weight' => '0', + 'info' => 'a:0:{}', + ], + ]; + // The expected results. + $tests[0]['expected_data'] = [ + [ + 'bid' => 2, + 'module' => 'system', + 'delta' => 'navigation', + 'theme' => 'bartik', + 'status' => 1, + 'weight' => 0, + 'region' => 'sidebar_first', + 'custom' => '0', + 'visibility' => 0, + 'pages' => '', + 'title' => 'Navigation', + 'cache' => -1, + 'i18n_mode' => 1, + 'lid' => 1, + 'translation' => 'fr - Navigation', + 'language' => 'fr', + 'plid' => 0, + 'plural' => 0, + 'i18n_status' => 0, + ], + ]; + + return $tests; + } + +} diff --git a/core/modules/content_translation/migrations/d7_block_translation.yml b/core/modules/content_translation/migrations/d7_block_translation.yml new file mode 100644 index 0000000000000000000000000000000000000000..a664ec17f391ef9850cd33597cf318b6bb28237d --- /dev/null +++ b/core/modules/content_translation/migrations/d7_block_translation.yml @@ -0,0 +1,77 @@ +id: d7_block_translation +label: Block translation +migration_tags: + - Drupal 7 + - Configuration + - Multilingual +source: + plugin: d7_block_translation + constants: + dest_label: 'settings/label' +process: + multilingual: + plugin: skip_on_empty + source: i18n_mode + method: row + langcode: language + property: constants/dest_label + translation: translation + id: + - + plugin: migration_lookup + migration: d7_block + source: + - module + - delta + - + plugin: skip_on_empty + method: row + # The plugin process is copied from d7_block.yml + plugin: + - + plugin: static_map + bypass: true + source: + - module + - delta + map: + book: + navigation: book_navigation + comment: + recent: views_block:comments_recent-block_1 + forum: + active: forum_active_block + new: forum_new_block + # locale: + # 0: language_block + node: + syndicate: node_syndicate_block + search: + form: search_form_block + statistics: + popular: statistics_popular_block + system: + main: system_main_block + 'powered-by': system_powered_by_block + user: + login: user_login_block + # 1: system_menu_block:tools + new: views_block:who_s_new-block_1 + online: views_block:who_s_online-who_s_online_block + - + plugin: block_plugin_id + - + plugin: skip_on_empty + method: row + # The theme process is copied from d7_block.yml + theme: + plugin: block_theme + source: + - theme + - default_theme + - admin_theme +destination: + plugin: entity:block +migration_dependencies: + optional: + - d7_block diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal7.php b/core/modules/migrate_drupal/tests/fixtures/drupal7.php index 3f5242e3c8284c5a40ce6d22a41e492b682252fe..9be6c119eb82c9b371cb230ed18bf67eeaf3a11d 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php @@ -11,286 +11,6 @@ $connection = Database::getConnection(); -$connection->schema()->createTable('i18n_block_language', array( - 'fields' => array( - 'module' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '64', - ), - 'delta' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '32', - ), - 'language' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '12', - 'default' => '', - ), - ), - 'primary key' => array( - 'module', - 'delta', - 'language', - ), - 'indexes' => array( - 'language' => array( - 'language', - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->schema()->createTable('i18n_string', array( - 'fields' => array( - 'lid' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'normal', - 'default' => '0', - ), - 'textgroup' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '50', - 'default' => 'default', - ), - 'context' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'objectid' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'type' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'property' => array( - 'type' => 'varchar', - 'not null' => TRUE, - 'length' => '255', - 'default' => '', - ), - 'objectindex' => array( - 'type' => 'int', - 'not null' => TRUE, - 'size' => 'big', - 'default' => '0', - ), - 'format' => array( - 'type' => 'varchar', - 'not null' => FALSE, - 'length' => '255', - ), - ), - 'primary key' => array( - 'lid', - ), - 'indexes' => array( - 'group_context' => array( - 'textgroup', - array( - 'context', - '50', - ), - ), - ), - 'mysql_character_set' => 'utf8', -)); - -$connection->insert('i18n_string') -->fields(array( - 'lid', - 'textgroup', - 'context', - 'objectid', - 'type', - 'property', - 'objectindex', - 'format', -)) -->values(array( - 'lid' => '57', - 'textgroup' => 'blocks', - 'context' => 'block:1:title', - 'objectid' => '1', - 'type' => 'block', - 'property' => 'title', - 'objectindex' => '1', - 'format' => '', -)) -->values(array( - 'lid' => '60', - 'textgroup' => 'blocks', - 'context' => 'block:1:body', - 'objectid' => '1', - 'type' => 'block', - 'property' => 'body', - 'objectindex' => '1', - 'format' => 'filtered_html', -)) -->values(array( - 'lid' => '61', - 'textgroup' => 'node', - 'context' => 'type:article:name', - 'objectid' => 'article', - 'type' => 'type', - 'property' => 'name', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '62', - 'textgroup' => 'node', - 'context' => 'type:article:title_label', - 'objectid' => 'article', - 'type' => 'type', - 'property' => 'title_label', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '63', - 'textgroup' => 'node', - 'context' => 'type:article:description', - 'objectid' => 'article', - 'type' => 'type', - 'property' => 'description', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '64', - 'textgroup' => 'node', - 'context' => 'type:article:help', - 'objectid' => 'article', - 'type' => 'type', - 'property' => 'help', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '65', - 'textgroup' => 'node', - 'context' => 'type:book:name', - 'objectid' => 'book', - 'type' => 'type', - 'property' => 'name', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '66', - 'textgroup' => 'node', - 'context' => 'type:book:title_label', - 'objectid' => 'book', - 'type' => 'type', - 'property' => 'title_label', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '67', - 'textgroup' => 'node', - 'context' => 'type:book:description', - 'objectid' => 'book', - 'type' => 'type', - 'property' => 'description', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '68', - 'textgroup' => 'node', - 'context' => 'type:page:name', - 'objectid' => 'page', - 'type' => 'type', - 'property' => 'name', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '69', - 'textgroup' => 'node', - 'context' => 'type:page:title_label', - 'objectid' => 'page', - 'type' => 'type', - 'property' => 'title_label', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '70', - 'textgroup' => 'node', - 'context' => 'type:page:description', - 'objectid' => 'page', - 'type' => 'type', - 'property' => 'description', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '71', - 'textgroup' => 'node', - 'context' => 'type:page:help', - 'objectid' => 'page', - 'type' => 'type', - 'property' => 'help', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '72', - 'textgroup' => 'node', - 'context' => 'type:test_content_type:name', - 'objectid' => 'test_content_type', - 'type' => 'type', - 'property' => 'name', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '73', - 'textgroup' => 'node', - 'context' => 'type:test_content_type:title_label', - 'objectid' => 'test_content_type', - 'type' => 'type', - 'property' => 'title_label', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '74', - 'textgroup' => 'node', - 'context' => 'type:test_content_type:description', - 'objectid' => 'test_content_type', - 'type' => 'type', - 'property' => 'description', - 'objectindex' => '0', - 'format' => '', -)) -->values(array( - 'lid' => '75', - 'textgroup' => 'node', - 'context' => 'type:test_content_type:help', - 'objectid' => 'test_content_type', - 'type' => 'type', - 'property' => 'help', - 'objectindex' => '0', - 'format' => '', -)) -->execute(); - $connection->schema()->createTable('accesslog', array( 'fields' => array( 'aid' => array( @@ -1316,6 +1036,12 @@ 'size' => 'normal', 'default' => '1', ), + 'i18n_mode' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), ), 'primary key' => array( 'bid', @@ -1337,6 +1063,7 @@ 'pages', 'title', 'cache', + 'i18n_mode', )) ->values(array( 'bid' => '1', @@ -1351,6 +1078,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '2', @@ -1365,6 +1093,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '3', @@ -1379,6 +1108,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '4', @@ -1391,8 +1121,9 @@ 'custom' => '0', 'visibility' => '0', 'pages' => '', - 'title' => '', + 'title' => 'User login title', 'cache' => '-1', + 'i18n_mode' => '1', )) ->values(array( 'bid' => '5', @@ -1407,6 +1138,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '6', @@ -1421,6 +1153,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '7', @@ -1435,6 +1168,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '8', @@ -1449,6 +1183,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '9', @@ -1463,6 +1198,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '10', @@ -1475,8 +1211,9 @@ 'custom' => '0', 'visibility' => '0', 'pages' => '', - 'title' => '', + 'title' => 'User login title', 'cache' => '-1', + 'i18n_mode' => '1', )) ->values(array( 'bid' => '11', @@ -1491,6 +1228,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '12', @@ -1505,6 +1243,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '13', @@ -1519,6 +1258,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '14', @@ -1533,6 +1273,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '15', @@ -1547,6 +1288,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '16', @@ -1561,6 +1303,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '17', @@ -1575,6 +1318,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '18', @@ -1589,6 +1333,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '19', @@ -1603,6 +1348,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '20', @@ -1617,6 +1363,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '21', @@ -1631,6 +1378,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '22', @@ -1645,6 +1393,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '23', @@ -1659,6 +1408,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '24', @@ -1673,6 +1423,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '25', @@ -1687,6 +1438,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '26', @@ -1701,6 +1453,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '27', @@ -1715,6 +1468,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '28', @@ -1729,6 +1483,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '29', @@ -1743,6 +1498,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '30', @@ -1757,6 +1513,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '31', @@ -1771,6 +1528,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '32', @@ -1785,6 +1543,7 @@ 'pages' => '', 'title' => '', 'cache' => '5', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '33', @@ -1799,6 +1558,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '34', @@ -1813,6 +1573,7 @@ 'pages' => '', 'title' => '', 'cache' => '-2', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '35', @@ -1827,6 +1588,7 @@ 'pages' => '', 'title' => '', 'cache' => '-2', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '36', @@ -1841,6 +1603,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '37', @@ -1855,6 +1618,7 @@ 'pages' => '', 'title' => '', 'cache' => '5', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '38', @@ -1869,6 +1633,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '39', @@ -1883,6 +1648,7 @@ 'pages' => '', 'title' => '', 'cache' => '-2', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '40', @@ -1897,6 +1663,7 @@ 'pages' => '', 'title' => '', 'cache' => '-2', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '41', @@ -1911,6 +1678,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '42', @@ -1925,6 +1693,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '43', @@ -1939,6 +1708,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '44', @@ -1953,6 +1723,7 @@ 'pages' => '', 'title' => '', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '45', @@ -1967,6 +1738,7 @@ 'pages' => '', 'title' => 'Mildly amusing limerick of the day', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '46', @@ -1981,6 +1753,7 @@ 'pages' => '', 'title' => 'Mildly amusing limerick of the day', 'cache' => '-1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '47', @@ -1995,6 +1768,7 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', )) ->values(array( 'bid' => '48', @@ -2009,6 +1783,37 @@ 'pages' => '', 'title' => '', 'cache' => '1', + 'i18n_mode' => '0', +)) +->values(array( + 'bid' => '49', + 'module' => 'locale', + 'delta' => 'language_content', + 'theme' => 'bartik', + 'status' => '0', + 'weight' => '0', + 'region' => '-1', + 'custom' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1', + 'i18n_mode' => '0', +)) +->values(array( + 'bid' => '50', + 'module' => 'locale', + 'delta' => 'language_content', + 'theme' => 'seven', + 'status' => '0', + 'weight' => '0', + 'region' => '-1', + 'custom' => '0', + 'visibility' => '0', + 'pages' => '', + 'title' => '', + 'cache' => '-1', + 'i18n_mode' => '0', )) ->execute(); @@ -2632,6 +2437,49 @@ 'mysql_character_set' => 'utf8', )); +$connection->schema()->createTable('cache_variable', array( + 'fields' => array( + 'cid' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '255', + 'default' => '', + ), + 'data' => array( + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'created' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'serialized' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'small', + 'default' => '0', + ), + ), + 'primary key' => array( + 'cid', + ), + 'indexes' => array( + 'expire' => array( + 'expire', + ), + ), + 'mysql_character_set' => 'utf8', +)); + $connection->schema()->createTable('cache_views', array( 'fields' => array( 'cid' => array( @@ -14702,6 +14550,296 @@ 'mysql_character_set' => 'utf8', )); +$connection->schema()->createTable('i18n_block_language', array( + 'fields' => array( + 'module' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '64', + ), + 'delta' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '32', + ), + 'language' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '12', + 'default' => '', + ), + ), + 'primary key' => array( + 'module', + 'delta', + 'language', + ), + 'indexes' => array( + 'language' => array( + 'language', + ), + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->schema()->createTable('i18n_string', array( + 'fields' => array( + 'lid' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'normal', + 'default' => '0', + ), + 'textgroup' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '50', + 'default' => 'default', + ), + 'context' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '255', + 'default' => '', + ), + 'objectid' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '255', + 'default' => '', + ), + 'type' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '255', + 'default' => '', + ), + 'property' => array( + 'type' => 'varchar', + 'not null' => TRUE, + 'length' => '255', + 'default' => '', + ), + 'objectindex' => array( + 'type' => 'int', + 'not null' => TRUE, + 'size' => 'big', + 'default' => '0', + ), + 'format' => array( + 'type' => 'varchar', + 'not null' => FALSE, + 'length' => '255', + ), + ), + 'primary key' => array( + 'lid', + ), + 'indexes' => array( + 'group_context' => array( + 'textgroup', + array( + 'context', + '50', + ), + ), + ), + 'mysql_character_set' => 'utf8', +)); + +$connection->insert('i18n_string') +->fields(array( + 'lid', + 'textgroup', + 'context', + 'objectid', + 'type', + 'property', + 'objectindex', + 'format', +)) +->values(array( + 'lid' => '57', + 'textgroup' => 'blocks', + 'context' => 'block:1:title', + 'objectid' => '1', + 'type' => 'block', + 'property' => 'title', + 'objectindex' => '1', + 'format' => '', +)) +->values(array( + 'lid' => '60', + 'textgroup' => 'blocks', + 'context' => 'block:1:body', + 'objectid' => '1', + 'type' => 'block', + 'property' => 'body', + 'objectindex' => '1', + 'format' => 'filtered_html', +)) +->values(array( + 'lid' => '61', + 'textgroup' => 'node', + 'context' => 'type:article:name', + 'objectid' => 'article', + 'type' => 'type', + 'property' => 'name', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '62', + 'textgroup' => 'node', + 'context' => 'type:article:title_label', + 'objectid' => 'article', + 'type' => 'type', + 'property' => 'title_label', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '63', + 'textgroup' => 'node', + 'context' => 'type:article:description', + 'objectid' => 'article', + 'type' => 'type', + 'property' => 'description', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '64', + 'textgroup' => 'node', + 'context' => 'type:article:help', + 'objectid' => 'article', + 'type' => 'type', + 'property' => 'help', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '65', + 'textgroup' => 'node', + 'context' => 'type:book:name', + 'objectid' => 'book', + 'type' => 'type', + 'property' => 'name', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '66', + 'textgroup' => 'node', + 'context' => 'type:book:title_label', + 'objectid' => 'book', + 'type' => 'type', + 'property' => 'title_label', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '67', + 'textgroup' => 'node', + 'context' => 'type:book:description', + 'objectid' => 'book', + 'type' => 'type', + 'property' => 'description', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '68', + 'textgroup' => 'node', + 'context' => 'type:page:name', + 'objectid' => 'page', + 'type' => 'type', + 'property' => 'name', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '69', + 'textgroup' => 'node', + 'context' => 'type:page:title_label', + 'objectid' => 'page', + 'type' => 'type', + 'property' => 'title_label', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '70', + 'textgroup' => 'node', + 'context' => 'type:page:description', + 'objectid' => 'page', + 'type' => 'type', + 'property' => 'description', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '71', + 'textgroup' => 'node', + 'context' => 'type:page:help', + 'objectid' => 'page', + 'type' => 'type', + 'property' => 'help', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '72', + 'textgroup' => 'node', + 'context' => 'type:test_content_type:name', + 'objectid' => 'test_content_type', + 'type' => 'type', + 'property' => 'name', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '73', + 'textgroup' => 'node', + 'context' => 'type:test_content_type:title_label', + 'objectid' => 'test_content_type', + 'type' => 'type', + 'property' => 'title_label', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '74', + 'textgroup' => 'node', + 'context' => 'type:test_content_type:description', + 'objectid' => 'test_content_type', + 'type' => 'type', + 'property' => 'description', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '75', + 'textgroup' => 'node', + 'context' => 'type:test_content_type:help', + 'objectid' => 'test_content_type', + 'type' => 'type', + 'property' => 'help', + 'objectindex' => '0', + 'format' => '', +)) +->values(array( + 'lid' => '76', + 'textgroup' => 'blocks', + 'context' => 'user:login:title', + 'objectid' => 'login', + 'type' => 'user', + 'property' => 'title', + 'objectindex' => '0', + 'format' => '', +)) +->execute(); + $connection->schema()->createTable('image_effects', array( 'fields' => array( 'ieid' => array( @@ -15010,6 +15148,15 @@ 'primary key' => array( 'lid', ), + 'indexes' => array( + 'textgroup_context' => array( + 'textgroup', + array( + 'context', + '50', + ), + ), + ), 'mysql_character_set' => 'utf8', )); @@ -15622,6 +15769,14 @@ 'context' => 'type:test_content_type:help', 'version' => '1', )) +->values(array( + 'lid' => '76', + 'location' => 'blocks:user:login:title', + 'textgroup' => 'blocks', + 'source' => 'User login title', + 'context' => 'user:login:title', + 'version' => '1', +)) ->execute(); $connection->schema()->createTable('locales_target', array( @@ -15695,7 +15850,7 @@ 'plural' => '0', 'i18n_status' => '0', )) -->values(array( + ->values(array( 'lid' => '57', 'translation' => 'is - Mildly amusing limerick of the day', 'language' => 'is', @@ -15703,6 +15858,14 @@ 'plural' => '0', 'i18n_status' => '0', )) +->values(array( + 'lid' => '76', + 'translation' => 'fr - User login title', + 'language' => 'fr', + 'plid' => '0', + 'plural' => '0', + 'i18n_status' => '0', +)) ->execute(); $connection->schema()->createTable('menu_custom', array( @@ -46256,6 +46419,16 @@ 'permission' => 'switch shortcut sets', 'module' => 'shortcut', )) +->values(array( + 'rid' => '3', + 'permission' => 'translate admin strings', + 'module' => 'i18n_string', +)) +->values(array( + 'rid' => '3', + 'permission' => 'translate blocks', + 'module' => 'i18n_block', +)) ->values(array( 'rid' => '3', 'permission' => 'translate content', @@ -46266,6 +46439,11 @@ 'permission' => 'translate interface', 'module' => 'locale', )) +->values(array( + 'rid' => '3', + 'permission' => 'translate user-defined strings', + 'module' => 'i18n_string', +)) ->values(array( 'rid' => '3', 'permission' => 'use advanced search', @@ -48917,11 +49095,11 @@ 'name' => 'i18n_block', 'type' => 'module', 'owner' => '', - 'status' => '0', + 'status' => '1', 'bootstrap' => '0', - 'schema_version' => '-1', - 'weight' => '0', - 'info' => 'a:12:{s:4:"name";s:15:"Block languages";s:11:"description";s:68:"Enables language selector for blocks and optional block translation.";s:12:"dependencies";a:2:{i:0;s:5:"block";i:1;s:11:"i18n_string";}s:7:"package";s:35:"Multilingual - Internationalization";s:4:"core";s:3:"7.x";s:5:"files";a:2:{i:0;s:14:"i18n_block.inc";i:1;s:15:"i18n_block.test";}s:7:"version";s:8:"7.x-1.26";s:7:"project";s:4:"i18n";s:9:"datestamp";s:10:"1534531985";s:5:"mtime";i:1534531985;s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}', + 'schema_version' => '7001', + 'weight' => '100', + 'info' => 'a:12:{s:4:"name";s:15:"Block languages";s:11:"description";s:68:"Enables language selector for blocks and optional block translation.";s:12:"dependencies";a:2:{i:0;s:5:"block";i:1;s:11:"i18n_string";}s:7:"package";s:35:"Multilingual - Internationalization";s:4:"core";s:3:"7.x";s:5:"files";a:2:{i:0;s:14:"i18n_block.inc";i:1;s:15:"i18n_block.test";}s:7:"version";s:8:"7.x-1.25";s:7:"project";s:4:"i18n";s:9:"datestamp";s:10:"1531342125";s:5:"mtime";i:1537747250;s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}', )) ->values(array( 'filename' => 'sites/all/modules/i18n/i18n_contact/i18n_contact.module', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php index 66b24c8520861f41c59a8cfbd23bb90063121c0d..9e68d9dba15b84bfd2a93aed0eaefb92b496cec7 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php @@ -65,6 +65,7 @@ protected function getAvailablePaths() { 'filter', 'forum', 'image', + 'i18n_block', 'language', 'link', 'list', @@ -141,7 +142,6 @@ protected function getMissingPaths() { 'entity_translation_i18n_menu', 'entity_translation_upgrade', 'i18n', - 'i18n_block', 'i18n_contact', 'i18n_field', 'i18n_forum',