diff --git a/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php b/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php index d955fe4..a6d33d1 100644 --- a/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php +++ b/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentSettings.php @@ -47,7 +47,7 @@ public function fields() { public function prepareRow(Row $row) { $type = $row->getSourceProperty('type'); $row->setSourceProperty('language_content_type', $this->variableGet('language_content_type_' . $type, NULL)); - $row->setSourceProperty('i18n_lock_node', $this->variableGet('i18n_lock_node_' . $type, NULL)); + $row->setSourceProperty('i18n_lock_node', $this->variableGet('i18n_lock_node_' . $type, 0)); return parent::prepareRow($row); } diff --git a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php index c60a98d..ca382d3 100644 --- a/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php +++ b/core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\language\Kernel\Migrate\d6; +use Drupal\Core\Language\LanguageInterface; use Drupal\language\Entity\ContentLanguageSettings; use Drupal\language\Plugin\migrate\source\d6\LanguageContentSettings; use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase; @@ -47,4 +48,14 @@ public function testLanguageContent() { $this->assertSame($config->getDefaultLangcode(), 'site_default'); } + /** + * Tests migration of content language settings when there is no language lock. + */ + public function testLanguageContentWithNoLanguageLock() { + // Assert that a we can assign a language. + $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'employee'); + $this->assertSame($config->getDefaultLangcode(), 'current_interface'); + $this->assertTrue($config->isLanguageAlterable()); + } + } diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 766244e..7d1c020 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -45534,6 +45534,10 @@ 'value' => 's:1:"2";', )) ->values(array( + 'name' => 'language_content_type_employee', + 'value' => 's:1:"2";', +)) +->values(array( 'name' => 'i18n_lock_node_article', 'value' => 'i:1;', ))