summaryrefslogtreecommitdiffstats
path: root/core/modules
diff options
context:
space:
mode:
authorNathaniel Catchpole2018-11-15 14:36:25 (GMT)
committerNathaniel Catchpole2018-11-15 14:36:35 (GMT)
commitf8b5d5af548c8ea20d4141c532005a64244a37c1 (patch)
tree5b175e3830520aae6cbe7438aa5f8795c348b802 /core/modules
parenta0c92ff16177170ac2e57b9f62356f39ed156704 (diff)
Issue #3008025 by quietone: Migrate D7 i18n block translated strings
(cherry picked from commit 9444c6a26a3b5fb78a9e1ebd353604f9af638360)
Diffstat (limited to 'core/modules')
-rw-r--r--core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php99
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php69
-rw-r--r--core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php4
-rw-r--r--core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php147
-rw-r--r--core/modules/content_translation/migrations/d7_block_translation.yml77
-rw-r--r--core/modules/migrate_drupal/tests/fixtures/drupal7.php752
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php2
7 files changed, 860 insertions, 290 deletions
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 0000000..acf9e2b
--- /dev/null
+++ b/core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php
@@ -0,0 +1,99 @@
+<?php
+
+namespace Drupal\block\Plugin\migrate\source\d7;
+
+use Drupal\block\Plugin\migrate\source\Block;
+
+/**
+ * Gets i18n block data from source database.
+ *
+ * @MigrateSource(
+ * id = "d7_block_translation",
+ * source_module = "i18n_block"
+ * )
+ */
+class BlockTranslation extends Block {
+
+ /**
+ * {@inheritdoc}
+ */
+ public function query() {
+ // Let the parent set the block table to use, but do not use the parent
+ // query. Instead build a query so can use an inner join to the selected
+ // block table.
+ parent::query();
+ $query = $this->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 0000000..0d082a8
--- /dev/null
+++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockContentTranslationTest.php
@@ -0,0 +1,69 @@
+<?php
+
+namespace Drupal\Tests\block\Kernel\Migrate\d7;
+
+use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
+
+/**
+ * Tests migration of i18n block translations.
+ *
+ * @group migrate_drupal_7
+ */
+class MigrateBlockContentTranslationTest extends MigrateDrupal7TestBase {
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $modules = [
+ 'node',
+ 'text',
+ 'aggregator',
+ 'book',
+ 'block',
+ 'comment',
+ 'forum',
+ 'views',
+ 'block_content',
+ 'config_translation',
+ 'content_translation',
+ 'language',
+ 'statistics',
+ 'taxonomy',
+ // Required for translation migrations.
+ 'migrate_drupal_multilingual',
+ ];
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function setUp() {
+ parent::setUp();
+ $this->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 6f07dc9..d56b9ed 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 @@ class MigrateBlockTest extends MigrateDrupal7TestBase {
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 0000000..01b2dce
--- /dev/null
+++ b/core/modules/block/tests/src/Kernel/Plugin/migrate/source/d7/BlockTranslationTest.php
@@ -0,0 +1,147 @@
+<?php
+
+namespace Drupal\Tests\block\Kernel\Plugin\migrate\source\d7;
+
+use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
+
+/**
+ * Tests i18n block source plugin.
+ *
+ * @covers \Drupal\block\Plugin\migrate\source\d7\BlockTranslation
+ *
+ * @group content_translation
+ */
+class BlockTranslationTest extends MigrateSqlSourceTestBase {
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $modules = ['block', 'migrate_drupal'];
+
+ /**
+ * {@inheritdoc}
+ */
+ public function providerSource() {
+
+ // The source data.
+ $tests[0]['source_data']['block'] = [
+ [
+ 'bid' => 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 0000000..a664ec1
--- /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 3f5242e..9be6c11 100644
--- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php
+++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php
@@ -11,286 +11,6 @@ use Drupal\Core\Database\Database;
$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 @@ $connection->schema()->createTable('block', array(
'size' => 'normal',
'default' => '1',
),
+ 'i18n_mode' => array(
+ 'type' => 'int',
+ 'not null' => TRUE,
+ 'size' => 'normal',
+ 'default' => '0',
+ ),
),
'primary key' => array(
'bid',
@@ -1337,6 +1063,7 @@ $connection->insert('block')
'pages',
'title',
'cache',
+ 'i18n_mode',
))
->values(array(
'bid' => '1',
@@ -1351,6 +1078,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '2',
@@ -1365,6 +1093,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '3',
@@ -1379,6 +1108,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '4',
@@ -1391,8 +1121,9 @@ $connection->insert('block')
'custom' => '0',
'visibility' => '0',
'pages' => '',
- 'title' => '',
+ 'title' => 'User login title',
'cache' => '-1',
+ 'i18n_mode' => '1',
))
->values(array(
'bid' => '5',
@@ -1407,6 +1138,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '6',
@@ -1421,6 +1153,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '7',
@@ -1435,6 +1168,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '8',
@@ -1449,6 +1183,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '9',
@@ -1463,6 +1198,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '10',
@@ -1475,8 +1211,9 @@ $connection->insert('block')
'custom' => '0',
'visibility' => '0',
'pages' => '',
- 'title' => '',
+ 'title' => 'User login title',
'cache' => '-1',
+ 'i18n_mode' => '1',
))
->values(array(
'bid' => '11',
@@ -1491,6 +1228,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '12',
@@ -1505,6 +1243,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '13',
@@ -1519,6 +1258,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '14',
@@ -1533,6 +1273,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '15',
@@ -1547,6 +1288,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '16',
@@ -1561,6 +1303,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '17',
@@ -1575,6 +1318,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '18',
@@ -1589,6 +1333,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '19',
@@ -1603,6 +1348,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '20',
@@ -1617,6 +1363,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '21',
@@ -1631,6 +1378,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '22',
@@ -1645,6 +1393,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '23',
@@ -1659,6 +1408,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '24',
@@ -1673,6 +1423,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '25',
@@ -1687,6 +1438,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '26',
@@ -1701,6 +1453,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '27',
@@ -1715,6 +1468,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '28',
@@ -1729,6 +1483,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '29',
@@ -1743,6 +1498,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '30',
@@ -1757,6 +1513,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '31',
@@ -1771,6 +1528,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '32',
@@ -1785,6 +1543,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '5',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '33',
@@ -1799,6 +1558,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '34',
@@ -1813,6 +1573,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-2',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '35',
@@ -1827,6 +1588,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-2',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '36',
@@ -1841,6 +1603,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '37',
@@ -1855,6 +1618,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '5',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '38',
@@ -1869,6 +1633,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '39',
@@ -1883,6 +1648,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-2',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '40',
@@ -1897,6 +1663,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-2',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '41',
@@ -1911,6 +1678,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '42',
@@ -1925,6 +1693,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '43',
@@ -1939,6 +1708,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '44',
@@ -1953,6 +1723,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '45',
@@ -1967,6 +1738,7 @@ $connection->insert('block')
'pages' => '',
'title' => 'Mildly amusing limerick of the day',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '46',
@@ -1981,6 +1753,7 @@ $connection->insert('block')
'pages' => '',
'title' => 'Mildly amusing limerick of the day',
'cache' => '-1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '47',
@@ -1995,6 +1768,7 @@ $connection->insert('block')
'pages' => '',
'title' => '',
'cache' => '1',
+ 'i18n_mode' => '0',
))
->values(array(
'bid' => '48',
@@ -2009,6 +1783,37 @@ $connection->insert('block')
'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 @@ $connection->schema()->createTable('cache_update', array(
'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 @@ $connection->schema()->createTable('history', array(
'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 @@ $connection->schema()->createTable('locales_source', array(
'primary key' => array(
'lid',
),
+ 'indexes' => array(
+ 'textgroup_context' => array(
+ 'textgroup',
+ array(
+ 'context',
+ '50',
+ ),
+ ),
+ ),
'mysql_character_set' => 'utf8',
));
@@ -15622,6 +15769,14 @@ $connection->insert('locales_source')
'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 @@ $connection->insert('locales_target')
'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 @@ $connection->insert('locales_target')
'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(
@@ -46258,6 +46421,16 @@ $connection->insert('role_permission')
))
->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',
'module' => 'translation',
))
@@ -46268,6 +46441,11 @@ $connection->insert('role_permission')
))
->values(array(
'rid' => '3',
+ 'permission' => 'translate user-defined strings',
+ 'module' => 'i18n_string',
+))
+->values(array(
+ 'rid' => '3',
'permission' => 'use advanced search',
'module' => 'search',
))
@@ -48917,11 +49095,11 @@ $connection->insert('system')
'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 66b24c85..9e68d9d 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 @@ class MigrateUpgrade7ReviewPageTest extends MigrateUpgradeReviewPageTestBase {
'filter',
'forum',
'image',
+ 'i18n_block',
'language',
'link',
'list',
@@ -141,7 +142,6 @@ class MigrateUpgrade7ReviewPageTest extends MigrateUpgradeReviewPageTestBase {
'entity_translation_i18n_menu',
'entity_translation_upgrade',
'i18n',
- 'i18n_block',
'i18n_contact',
'i18n_field',
'i18n_forum',