diff --git a/core/modules/comment/migration_templates/d6_comment_field_instance.yml b/core/modules/comment/migration_templates/d6_comment_field_instance.yml index d3e7207..a19699d 100644 --- a/core/modules/comment/migration_templates/d6_comment_field_instance.yml +++ b/core/modules/comment/migration_templates/d6_comment_field_instance.yml @@ -21,7 +21,15 @@ process: plugin: skip_on_empty method: row bundle: type - 'default_value/0/status': comment + 'default_value/0/status': + # We're using static_map instead of default_value otherwise if the source + # is 0, the default value of 1 would be used. + plugin: static_map + source: comment + map: + 0: 0 + 1: 1 + default_value: 1 'settings/default_mode': plugin: static_map source: comment_default_mode @@ -34,10 +42,28 @@ process: 3: 1 # COMMENT_MODE_THREADED_EXPANDED --> COMMENT_MODE_THREADED 4: 1 - 'settings/per_page': comment_default_per_page - 'settings/anonymous': comment_anonymous - 'settings/form_location': comment_form_location - 'settings/preview': comment_preview + default_value: 1 + 'settings/per_page': + plugin: default_value + source: comment_default_per_page + default_value: 50 + 'settings/anonymous': + plugin: default_value + source: comment_anonymous + default_value: 0 + 'settings/form_location': + plugin: default_value + source: comment_form_location + default_value: 0 + 'settings/preview': + # We're using static_map instead of default_value otherwise if the source + # is 0, the default value of 1 would be used. + plugin: static_map + source: comment_preview + map: + 0: 0 + 1: 1 + default_value: 1 destination: plugin: entity:field_config migration_dependencies: diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php index 7651717..2360b87 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentFieldInstanceTest.php @@ -64,8 +64,18 @@ protected function assertCommentField($node_type, $default_mode, $per_page, $ano * Test the migrated field instance values. */ public function testCommentFieldInstance() { + $this->assertCommentField('article', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('company', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('employee', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('event', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('forum', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); $this->assertCommentField('page', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('sponsor', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); $this->assertCommentField('story', CommentManagerInterface::COMMENT_MODE_FLAT, 70, 1, FALSE, 0); + $this->assertCommentField('test_event', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('test_page', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('test_planet', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); + $this->assertCommentField('test_story', CommentManagerInterface::COMMENT_MODE_THREADED, 50, 0, FALSE, 1); } } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php index b9febec..7178434 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php @@ -44,7 +44,7 @@ protected function getEntityCounts() { 'contact_form' => 5, 'configurable_language' => 5, 'editor' => 2, - 'field_config' => 85, + 'field_config' => 87, 'field_storage_config' => 59, 'file' => 7, 'filter_format' => 7,