diff --git a/core/modules/comment/migration_templates/d7_comment.yml b/core/modules/comment/migration_templates/d7_comment.yml index 2f843e0..d23f7be 100644 --- a/core/modules/comment/migration_templates/d7_comment.yml +++ b/core/modules/comment/migration_templates/d7_comment.yml @@ -19,17 +19,17 @@ process: comment_type: plugin: static_map source: comment_type + bypass: true map: - comment_node_forum: comment_forum comment_node_article: comment - bypass: true + comment_node_forum: comment_forum field_name: plugin: static_map source: comment_type + bypass: true map: - comment_node_forum: comment_forum comment_node_article: comment - bypass: true + comment_node_forum: comment_forum subject: subject uid: uid name: name diff --git a/core/modules/comment/migration_templates/d7_comment_entity_display.yml b/core/modules/comment/migration_templates/d7_comment_entity_display.yml index 08f0df4..96176fd 100644 --- a/core/modules/comment/migration_templates/d7_comment_entity_display.yml +++ b/core/modules/comment/migration_templates/d7_comment_entity_display.yml @@ -14,11 +14,12 @@ source: process: entity_type: 'constants/entity_type' field_name: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum view_mode: 'constants/view_mode' options: 'constants/options' bundle: node_type diff --git a/core/modules/comment/migration_templates/d7_comment_entity_form_display_subject.yml b/core/modules/comment/migration_templates/d7_comment_entity_form_display_subject.yml index 51d8f02..6f8c939 100644 --- a/core/modules/comment/migration_templates/d7_comment_entity_form_display_subject.yml +++ b/core/modules/comment/migration_templates/d7_comment_entity_form_display_subject.yml @@ -23,11 +23,12 @@ process: 0: true 1: false bundle: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum destination: plugin: component_entity_form_display migration_dependencies: diff --git a/core/modules/comment/migration_templates/d7_comment_field.yml b/core/modules/comment/migration_templates/d7_comment_field.yml index b12b4e6..eb58666 100644 --- a/core/modules/comment/migration_templates/d7_comment_field.yml +++ b/core/modules/comment/migration_templates/d7_comment_field.yml @@ -10,13 +10,20 @@ source: process: entity_type: 'constants/entity_type' field_name: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum type: 'constants/type' - 'settings/comment_type': bundle + 'settings/comment_type': + plugin: static_map + source: bundle + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum destination: plugin: entity:field_storage_config migration_dependencies: diff --git a/core/modules/comment/migration_templates/d7_comment_field_instance.yml b/core/modules/comment/migration_templates/d7_comment_field_instance.yml index abc3e6e..430a73f 100644 --- a/core/modules/comment/migration_templates/d7_comment_field_instance.yml +++ b/core/modules/comment/migration_templates/d7_comment_field_instance.yml @@ -13,11 +13,12 @@ process: label: 'constants/label' required: 'constants/required' field_name: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum bundle: node_type 'default_value/0/status': 'constants/required' 'settings/default_mode': default_mode diff --git a/core/modules/comment/migration_templates/d7_comment_type.yml b/core/modules/comment/migration_templates/d7_comment_type.yml index d975935..e6c1c59 100644 --- a/core/modules/comment/migration_templates/d7_comment_type.yml +++ b/core/modules/comment/migration_templates/d7_comment_type.yml @@ -9,11 +9,12 @@ source: process: target_entity_type_id: 'constants/entity_type' id: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum label: label destination: plugin: entity:comment_type diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php index c478220..b64ed72 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php @@ -50,11 +50,9 @@ protected function assertDisplay($id, $component_id) { */ public function testMigration() { $this->assertDisplay('node.page.default', 'comment_node_page'); - // Article comments use standard D8 comment field. $this->assertDisplay('node.article.default', 'comment'); $this->assertDisplay('node.book.default', 'comment_node_book'); $this->assertDisplay('node.blog.default', 'comment_node_blog'); - // Forum comments use standard D8 comment_forum field. $this->assertDisplay('node.forum.default', 'comment_forum'); $this->assertDisplay('node.test_content_type.default', 'comment_node_test_content_type'); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php index 8ce439a..5c9e63c 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php @@ -45,10 +45,10 @@ protected function assertDisplay($id) { */ public function testMigration() { $this->assertDisplay('comment.comment_node_page.default'); - $this->assertDisplay('comment.comment_node_article.default'); + $this->assertDisplay('comment.comment.default'); $this->assertDisplay('comment.comment_node_book.default'); $this->assertDisplay('comment.comment_node_blog.default'); - $this->assertDisplay('comment.comment_node_forum.default'); + $this->assertDisplay('comment.comment_forum.default'); $this->assertDisplay('comment.comment_node_test_content_type.default'); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php index cc82c82..7172dac 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php @@ -76,10 +76,10 @@ protected function assertEntity($id, $field_name, $bundle, $default_mode, $per_p */ public function testMigration() { $this->assertEntity('node.page.comment_node_page', 'comment_node_page', 'page', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); - $this->assertEntity('node.article.comment_node_article', 'comment_node_article', 'article', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); + $this->assertEntity('node.article.comment', 'comment', 'article', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); $this->assertEntity('node.blog.comment_node_blog', 'comment_node_blog', 'blog', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); $this->assertEntity('node.book.comment_node_book', 'comment_node_book', 'book', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); - $this->assertEntity('node.forum.comment_node_forum', 'comment_node_forum', 'forum', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); + $this->assertEntity('node.forum.comment_forum', 'comment_forum', 'forum', TRUE, 50, FALSE, CommentItemInterface::FORM_BELOW, TRUE); $this->assertEntity('node.test_content_type.comment_node_test_content_type', 'comment_node_test_content_type', 'test_content_type', TRUE, 30, FALSE, CommentItemInterface::FORM_BELOW, TRUE); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php index b995bdb..1596aec 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php @@ -51,10 +51,10 @@ protected function assertEntity($id, $comment_type) { */ public function testMigration() { $this->assertEntity('node.comment_node_page', 'comment_node_page'); - $this->assertEntity('node.comment_node_article', 'comment_node_article'); + $this->assertEntity('node.comment', 'comment'); $this->assertEntity('node.comment_node_blog', 'comment_node_blog'); $this->assertEntity('node.comment_node_book', 'comment_node_book'); - $this->assertEntity('node.comment_node_forum', 'comment_node_forum'); + $this->assertEntity('node.comment_forum', 'comment_forum'); $this->assertEntity('node.comment_node_test_content_type', 'comment_node_test_content_type'); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php index 60f640d..f9996f6 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php @@ -48,10 +48,10 @@ protected function assertEntity($id, $label) { */ public function testMigration() { $this->assertEntity('comment_node_page', 'Basic page comment'); - $this->assertEntity('comment_node_article', 'Article comment'); + $this->assertEntity('comment', 'Article comment'); $this->assertEntity('comment_node_blog', 'Blog entry comment'); $this->assertEntity('comment_node_book', 'Book page comment'); - $this->assertEntity('comment_node_forum', 'Forum topic comment'); + $this->assertEntity('comment_forum', 'Forum topic comment'); $this->assertEntity('comment_node_test_content_type', 'Test content type comment'); $migration = $this->getMigration('d7_comment_type'); diff --git a/core/modules/field/migration_templates/d7_field_formatter_settings.yml b/core/modules/field/migration_templates/d7_field_formatter_settings.yml index 65abdbd..c0deba6 100644 --- a/core/modules/field/migration_templates/d7_field_formatter_settings.yml +++ b/core/modules/field/migration_templates/d7_field_formatter_settings.yml @@ -27,11 +27,12 @@ process: method: row entity_type: entity_type bundle: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum view_mode: - plugin: migration_lookup diff --git a/core/modules/field/migration_templates/d7_field_instance.yml b/core/modules/field/migration_templates/d7_field_instance.yml index 847d749..ef5594f 100644 --- a/core/modules/field/migration_templates/d7_field_instance.yml +++ b/core/modules/field/migration_templates/d7_field_instance.yml @@ -12,11 +12,12 @@ process: entity_type: entity_type field_name: field_name bundle: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum label: label description: description required: required diff --git a/core/modules/field/migration_templates/d7_field_instance_widget_settings.yml b/core/modules/field/migration_templates/d7_field_instance_widget_settings.yml index 57b8f3c..2a779a0 100644 --- a/core/modules/field/migration_templates/d7_field_instance_widget_settings.yml +++ b/core/modules/field/migration_templates/d7_field_instance_widget_settings.yml @@ -27,11 +27,12 @@ process: plugin: skip_on_empty method: row bundle: - plugin: skip_row_if_in_blacklist + plugin: static_map source: bundle - blacklist: - - comment_node_article - - comment_node_forum + bypass: true + map: + comment_node_article: comment + comment_node_forum: comment_forum form_mode: 'constants/form_mode' field_name: field_name entity_type: entity_type diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php index dd38569..8ba7c3b 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php @@ -44,7 +44,7 @@ protected function setUp() { 'label' => $this->randomMachineName(), ])->save(); CommentType::create([ - 'id' => 'comment_node_article', + 'id' => 'comment', 'label' => $this->randomMachineName(), ])->save(); CommentType::create([ @@ -56,7 +56,7 @@ protected function setUp() { 'label' => $this->randomMachineName(), ])->save(); CommentType::create([ - 'id' => 'comment_node_forum', + 'id' => 'comment_forum', 'label' => $this->randomMachineName(), ])->save(); CommentType::create([ @@ -206,8 +206,8 @@ protected function assertComponentNotExists($display_id, $component_id) { * Tests migration of D7 field formatter settings. */ public function testMigration() { - $this->assertEntity('comment.comment_node_article.default'); - $this->assertComponent('comment.comment_node_article.default', 'comment_body', 'text_default', 'hidden', 0); + $this->assertEntity('comment.comment.default'); + $this->assertComponent('comment.comment.default', 'comment_body', 'text_default', 'hidden', 0); $this->assertEntity('comment.comment_node_blog.default'); $this->assertComponent('comment.comment_node_blog.default', 'comment_body', 'text_default', 'hidden', 0); @@ -215,8 +215,8 @@ public function testMigration() { $this->assertEntity('comment.comment_node_book.default'); $this->assertComponent('comment.comment_node_book.default', 'comment_body', 'text_default', 'hidden', 0); - $this->assertEntity('comment.comment_node_forum.default'); - $this->assertComponent('comment.comment_node_forum.default', 'comment_body', 'text_default', 'hidden', 0); + $this->assertEntity('comment.comment_forum.default'); + $this->assertComponent('comment.comment_forum.default', 'comment_body', 'text_default', 'hidden', 0); $this->assertEntity('comment.comment_node_page.default'); $this->assertComponent('comment.comment_node_page.default', 'comment_body', 'text_default', 'hidden', 0); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php index 1e3df9e..88fb7f3 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php @@ -40,12 +40,12 @@ class MigrateFieldInstanceTest extends MigrateDrupal7TestBase { protected function setUp() { parent::setUp(); $this->installConfig(static::$modules); - $this->createType('page'); - $this->createType('article'); - $this->createType('blog'); - $this->createType('book'); - $this->createType('forum'); - $this->createType('test_content_type'); + $this->createType('page', 'comment_node_page'); + $this->createType('article', 'comment'); + $this->createType('blog', 'comment_node_blog'); + $this->createType('book', 'comment_node_book'); + $this->createType('forum', 'comment_forum'); + $this->createType('test_content_type', 'comment_node_test_content_type'); Vocabulary::create(['vid' => 'test_vocabulary'])->save(); $this->executeMigrations(['d7_field', 'd7_field_instance']); } @@ -56,14 +56,14 @@ protected function setUp() { * @param string $id * The node type ID. */ - protected function createType($id) { + protected function createType($node_type, $comment_type) { NodeType::create([ - 'type' => $id, + 'type' => $node_type, 'label' => $this->randomString(), ])->save(); CommentType::create([ - 'id' => 'comment_node_' . $id, + 'id' => $comment_type, 'label' => $this->randomString(), 'target_entity_type_id' => 'node', ])->save(); @@ -118,7 +118,7 @@ protected function assertLinkFields($id, $title_setting) { public function testFieldInstances() { $this->assertEntity('comment.comment_node_page.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.page.body', 'Body', 'text_with_summary', FALSE, FALSE); - $this->assertEntity('comment.comment_node_article.comment_body', 'Comment', 'text_long', TRUE, FALSE); + $this->assertEntity('comment.comment.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.article.body', 'Body', 'text_with_summary', FALSE, TRUE); $this->assertEntity('node.article.field_tags', 'Tags', 'entity_reference', FALSE, TRUE); $this->assertEntity('node.article.field_image', 'Image', 'image', FALSE, TRUE); @@ -127,7 +127,7 @@ public function testFieldInstances() { $this->assertEntity('comment.comment_node_book.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.book.body', 'Body', 'text_with_summary', FALSE, FALSE); $this->assertEntity('node.forum.taxonomy_forums', 'Forums', 'entity_reference', TRUE, FALSE); - $this->assertEntity('comment.comment_node_forum.comment_body', 'Comment', 'text_long', TRUE, FALSE); + $this->assertEntity('comment.comment_forum.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.forum.body', 'Body', 'text_with_summary', FALSE, FALSE); $this->assertEntity('comment.comment_node_test_content_type.comment_body', 'Comment', 'text_long', TRUE, FALSE); $this->assertEntity('node.test_content_type.field_boolean', 'Boolean', 'boolean', FALSE, FALSE); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php index e71ac3c..90c62cb 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/RollbackFieldInstanceTest.php @@ -26,7 +26,7 @@ public function testFieldInstances() { $field_instance_ids = [ 'comment.comment_node_page.comment_body', 'node.page.body', - 'comment.comment_node_article.comment_body', + 'comment.comment.comment_body', 'node.article.body', 'node.article.field_tags', 'node.article.field_image', @@ -35,7 +35,7 @@ public function testFieldInstances() { 'comment.comment_node_book.comment_body', 'node.book.body', 'node.forum.taxonomy_forums', - 'comment.comment_node_forum.comment_body', + 'comment.comment_forum.comment_body', 'node.forum.body', 'comment.comment_node_test_content_type.comment_body', 'node.test_content_type.field_boolean', diff --git a/core/modules/migrate/src/Plugin/migrate/process/SkipRowIfInBlacklist.php b/core/modules/migrate/src/Plugin/migrate/process/SkipRowIfInBlacklist.php deleted file mode 100644 index 9431e02..0000000 --- a/core/modules/migrate/src/Plugin/migrate/process/SkipRowIfInBlacklist.php +++ /dev/null @@ -1,60 +0,0 @@ -configuration['blacklist'])) { - $message = !empty($this->configuration['message']) ? $this->configuration['message'] : ''; - throw new MigrateSkipRowException($message); - } - return $value; - } - -} diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php index 6bb46a9..f9cdc40 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php @@ -40,13 +40,13 @@ protected function getEntityCounts() { 'block_content' => 1, 'block_content_type' => 1, 'comment' => 1, - 'comment_type' => 8, + 'comment_type' => 6, // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'. 'configurable_language' => 4, 'contact_form' => 3, 'editor' => 2, - 'field_config' => 52, - 'field_storage_config' => 39, + 'field_config' => 48, + 'field_storage_config' => 37, 'file' => 2, 'filter_format' => 7, 'image_style' => 6, @@ -68,9 +68,9 @@ protected function getEntityCounts() { 'menu_link_content' => 7, 'view' => 14, 'date_format' => 11, - 'entity_form_display' => 18, + 'entity_form_display' => 16, 'entity_form_mode' => 1, - 'entity_view_display' => 29, + 'entity_view_display' => 27, 'entity_view_mode' => 14, 'base_field_override' => 9, ];