diff --git a/core/modules/node/migrations/d6_node_type.yml b/core/modules/node/migrations/d6_node_type.yml index 3afe4bc475891e54411f7aca415bca9cc3e4ed6a..5c138c4683f1cda478b5d20cd4bc470a9fa000c7 100644 --- a/core/modules/node/migrations/d6_node_type.yml +++ b/core/modules/node/migrations/d6_node_type.yml @@ -21,7 +21,23 @@ process: 'settings/node/options': options create_body: has_body create_body_label: body_label - 'third_party_settings/menu_ui/available_menus': available_menus - 'third_party_settings/menu_ui/parent': parent + 'third_party_settings/menu_ui/available_menus': + plugin: static_map + bypass: true + source: available_menus + map: + main-menu: main + management: admin + navigation: tools + user-menu: account + 'third_party_settings/menu_ui/parent': + plugin: static_map + bypass: true + source: parent + map: + 'main-menu:': 'main:' + 'management:': 'admin:' + 'navigation:': 'tools:' + 'user-menu:': 'account:' destination: plugin: entity:node_type diff --git a/core/modules/node/migrations/d7_node_type.yml b/core/modules/node/migrations/d7_node_type.yml index 1be9cd1ccc3af3f8094bc900b893e35e87407998..bd9c727f4358cc7fee18a3674b2809de5a204988 100644 --- a/core/modules/node/migrations/d7_node_type.yml +++ b/core/modules/node/migrations/d7_node_type.yml @@ -18,7 +18,23 @@ process: new_revision: 'options/revision' create_body: create_body create_body_label: body_label - 'third_party_settings/menu_ui/available_menus': available_menus - 'third_party_settings/menu_ui/parent': parent + 'third_party_settings/menu_ui/available_menus': + plugin: static_map + bypass: true + source: available_menus + map: + main-menu: main + management: admin + navigation: tools + user-menu: account + 'third_party_settings/menu_ui/parent': + plugin: static_map + bypass: true + source: parent + map: + 'main-menu:0:': 'main:' + 'management:0:': 'admin:' + 'navigation:0:': 'tools:' + 'user-menu:0:': 'account:' destination: plugin: entity:node_type diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php index e42867f33defee5805e677905319d8989a5ece66..71e27caf827c8e933c27f1d508642293118b59d8 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTypeTest.php @@ -45,9 +45,9 @@ public function testNodeType() { $this->assertSame('This is the body field label', $field->getLabel(), 'Body field was found.'); // Test default menus. - $expected_available_menus = ['navigation']; + $expected_available_menus = ['tools']; $this->assertSame($expected_available_menus, $node_type_page->getThirdPartySetting('menu_ui', 'available_menus')); - $expected_parent = 'navigation:'; + $expected_parent = 'tools:'; $this->assertSame($expected_parent, $node_type_page->getThirdPartySetting('menu_ui', 'parent')); // Test the test_story content type. @@ -64,9 +64,9 @@ public function testNodeType() { $this->assertNull($field, 'No body field found'); // Test default menus. - $expected_available_menus = ['navigation']; + $expected_available_menus = ['tools']; $this->assertSame($expected_available_menus, $node_type_story->getThirdPartySetting('menu_ui', 'available_menus')); - $expected_parent = 'navigation:'; + $expected_parent = 'tools:'; $this->assertSame($expected_parent, $node_type_story->getThirdPartySetting('menu_ui', 'parent')); // Test the test_event content type. @@ -82,9 +82,9 @@ public function testNodeType() { $field = FieldConfig::loadByName('node', 'test_event', 'body'); $this->assertSame('Body', $field->getLabel(), 'Body field was found.'); - $expected_available_menus = ['navigation']; + $expected_available_menus = ['tools']; $this->assertSame($expected_available_menus, $node_type_event->getThirdPartySetting('menu_ui', 'available_menus')); - $expected_parent = 'navigation:'; + $expected_parent = 'tools:'; $this->assertSame($expected_parent, $node_type_event->getThirdPartySetting('menu_ui', 'parent')); // Test the 32 character type name exists. diff --git a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php index 70f2a26e1b52af31cd1930b9b8d3c60baf3cfd78..fce725328c21178231d78d24a5f1e58a6c1d9db3 100644 --- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php +++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTypeTest.php @@ -81,8 +81,8 @@ protected function assertEntity(string $id, string $label, string $description, * Tests Drupal 7 node type to Drupal 8 migration. */ public function testNodeType() { - $expected_available_menus = ['main-menu']; - $expected_parent = 'main-menu:0:'; + $expected_available_menus = ['main']; + $expected_parent = 'main:'; $this->assertEntity('article', 'Article', 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', 'Help text for articles', TRUE, FALSE, $expected_available_menus, $expected_parent, "Body"); $this->assertEntity('blog', 'Blog entry', 'Use for multi-user blogs. Every user gets a personal blog.', 'Blog away, good sir!', TRUE, FALSE, $expected_available_menus, $expected_parent, 'Body'); @@ -95,10 +95,10 @@ public function testNodeType() { // This node type does not carry a body field. $expected_available_menus = [ - 'main-menu', - 'management', - 'navigation', - 'user-menu', + 'main', + 'admin', + 'tools', + 'account', ]; $this->assertEntity('test_content_type', 'Test content type', 'This is the description of the test content type.', 'Help text for test content type', FALSE, TRUE, $expected_available_menus, $expected_parent); }