diff --git a/core/modules/language/migrations/d7_language_content_settings.yml b/core/modules/language/migrations/d7_language_content_settings.yml index ba170a489a977a2a2f6c274cca505acb46d4fab6..9428f42d4dfdc0ec999be8f72f16d89e3b4fec54 100644 --- a/core/modules/language/migrations/d7_language_content_settings.yml +++ b/core/modules/language/migrations/d7_language_content_settings.yml @@ -20,6 +20,8 @@ process: 0: NULL 1: 'current_interface' 2: 'current_interface' + 4: 'und' + default_value: NULL - plugin: skip_on_empty method: row @@ -38,6 +40,7 @@ process: 0: NULL 1: false 2: true + 4: true destination: plugin: entity:language_content_settings content_translation_update_definitions: diff --git a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php index fdba37073e4fcd549169c98c5e74c69ee6bd9887..e584467c92174c628e9f9ca0eb890225b5b0c952 100644 --- a/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php +++ b/core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentSettingsTest.php @@ -34,9 +34,9 @@ protected function setUp() { public function testLanguageContent() { // Assert that a translatable content is still translatable. $config = $this->config('language.content_settings.node.blog'); - $this->assertIdentical($config->get('target_entity_type_id'), 'node'); - $this->assertIdentical($config->get('target_bundle'), 'blog'); - $this->assertIdentical($config->get('default_langcode'), 'current_interface'); + $this->assertSame($config->get('target_entity_type_id'), 'node'); + $this->assertSame($config->get('target_bundle'), 'blog'); + $this->assertSame($config->get('default_langcode'), 'current_interface'); $this->assertFalse($config->get('language_alterable')); $this->assertTrue($config->get('third_party_settings.content_translation.enabled')); @@ -46,6 +46,23 @@ public function testLanguageContent() { $this->assertFalse($config->isLanguageAlterable()); $this->assertSame($config->getDefaultLangcode(), 'site_default'); + // Make sure there's no migration exceptions. + $messages = $this->migration->getIdMap()->getMessageIterator()->fetchAll(); + $this->assertEmpty($messages); + + // Assert that a content type translatable with entity_translation is still + // translatable. + $config = $this->config('language.content_settings.node.test_content_type'); + $this->assertTrue($config->get('third_party_settings.content_translation.enabled')); + $this->assertSame($config->get('default_langcode'), 'und'); + + // Assert that a content type without a 'language_content_type' variable is + // not translatable + $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'book'); + $this->assertTrue($config->isDefaultConfiguration()); + $this->assertFalse($config->isLanguageAlterable()); + $this->assertSame($config->getDefaultLangcode(), 'site_default'); + } } diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal7.php b/core/modules/migrate_drupal/tests/fixtures/drupal7.php index 3624a4a92fba806a62e03a7c692558b7eeb757f3..1d6d1d33a5e3ea72c60e756a671ece3751f95e3a 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php @@ -49585,10 +49585,6 @@ 'name' => 'language_content_type_blog', 'value' => 's:1:"2";', )) -->values(array( - 'name' => 'language_content_type_book', - 'value' => 's:1:"0";', -)) ->values(array( 'name' => 'language_content_type_forum', 'value' => 's:1:"0";',