diff --git a/core/modules/block/migrations/d6_block.yml b/core/modules/block/migrations/d6_block.yml index 684672b267796f744a49d1feb589f285a4e00052..f74eb8e059918bc25bc5691b1f410ef47611496e 100644 --- a/core/modules/block/migrations/d6_block.yml +++ b/core/modules/block/migrations/d6_block.yml @@ -71,12 +71,12 @@ process: - region map: garland: - bartik: - # Garland 6.x --> Bartik 8.x + olivero: + # Garland 6.x --> Olivero header: header - footer: footer_fifth - left: sidebar_first - right: sidebar_second + footer: footer_top + left: sidebar + right: sidebar # If mapping fails, put the block in the content region. default_value: content weight: weight diff --git a/core/modules/block/migrations/d7_block.yml b/core/modules/block/migrations/d7_block.yml index 3b301ef0cd100812e9f02e4f1d6e7b880f113770..ad7fa7f941904fb518aaca1f91228e5ec87af15f 100644 --- a/core/modules/block/migrations/d7_block.yml +++ b/core/modules/block/migrations/d7_block.yml @@ -74,17 +74,29 @@ process: - region map: bartik: - bartik: - # Bartik 7.x --> Bartik 8.x - featured: featured_top - triptych_first: featured_bottom_first - triptych_middle: featured_bottom_second - triptych_last: featured_bottom_third - footer_firstcolumn: footer_first - footer_secondcolumn: footer_second - footer_thirdcolumn: footer_third - footer_fourthcolumn: footer_fourth - footer: footer_fifth + # Bartik 7.x --> Olivero 9.4.x + olivero: + featured: highlighted + triptych_first: content_below + triptych_middle: content_below + triptych_last: content_below + footer_firstcolumn: footer_top + footer_secondcolumn: footer_top + footer_thirdcolumn: footer_top + footer_fourthcolumn: footer_top + footer: footer_bottom + seven: + # Seven 7.x --> Claro 9.4.x + claro: + header: 'header' + pre_content: 'pre_content' + breadcrumb: 'breadcrumb' + highlighted: 'highlighted' + help: 'help' + content: 'content' + page_top: 'page_top' + page_bottom: 'page_bottom' + sidebar_first: 'sidebar_first' # If mapping fails, put the block in the content region. default_value: content weight: weight diff --git a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php index 55f48c3e5a5a65f55fe8b4251cc036a01e83493d..10c5946256c8a9bfb41b255277ef77d94d022687 100644 --- a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php +++ b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php @@ -36,14 +36,14 @@ protected function setUp(): void { parent::setUp(); // Install the themes used for this test. - $this->container->get('theme_installer')->install(['bartik', 'test_theme']); - $this->installEntitySchema('block_content'); + $this->container->get('theme_installer')->install(['olivero', 'test_theme']); + $this->installConfig(['block_content']); - // Set Bartik as the default public theme. + // Set Olivero as the default public theme. $config = $this->config('system.theme'); - $config->set('default', 'bartik'); + $config->set('default', 'olivero'); $config->save(); $this->executeMigrations([ @@ -97,7 +97,7 @@ public function assertEntity(string $id, array $visibility, string $region, stri */ public function testBlockMigration() { $blocks = Block::loadMultiple(); - $this->assertCount(14, $blocks); + $this->assertCount(25, $blocks); // Check user blocks. $visibility = [ @@ -113,7 +113,7 @@ public function testBlockMigration() { 'provider' => 'user', 'label_display' => '0', ]; - $this->assertEntity('user', $visibility, 'sidebar_first', 'bartik', -10, $settings); + $this->assertEntity('user', $visibility, 'sidebar', 'olivero', -10, $settings); $visibility = []; $settings = [ @@ -125,7 +125,7 @@ public function testBlockMigration() { 'expand_all_items' => FALSE, 'depth' => 0, ]; - $this->assertEntity('user_1', $visibility, 'sidebar_first', 'bartik', -11, $settings); + $this->assertEntity('user_1', $visibility, 'sidebar', 'olivero', -11, $settings); $visibility = [ 'user_role' => [ @@ -146,7 +146,7 @@ public function testBlockMigration() { 'label_display' => '0', 'items_per_page' => '5', ]; - $this->assertEntity('user_2', $visibility, 'sidebar_second', 'bartik', -11, $settings); + $this->assertEntity('user_2', $visibility, 'sidebar', 'olivero', -11, $settings); $visibility = [ 'user_role' => [ @@ -167,7 +167,7 @@ public function testBlockMigration() { 'label_display' => '0', 'items_per_page' => '10', ]; - $this->assertEntity('user_3', $visibility, 'sidebar_second', 'bartik', -10, $settings); + $this->assertEntity('user_3', $visibility, 'sidebar', 'olivero', -10, $settings); // Check system block. $visibility = [ @@ -183,7 +183,7 @@ public function testBlockMigration() { 'provider' => 'system', 'label_display' => '0', ]; - $this->assertEntity('system', $visibility, 'footer_fifth', 'bartik', -5, $settings); + $this->assertEntity('system', $visibility, 'footer_top', 'olivero', -5, $settings); // Check menu blocks. $settings = [ @@ -192,7 +192,7 @@ public function testBlockMigration() { 'provider' => 'core', 'label_display' => '0', ]; - $this->assertEntity('menu', [], 'header', 'bartik', -5, $settings); + $this->assertEntity('menu', [], 'header', 'olivero', -5, $settings); // Check aggregator block. $settings = [ @@ -203,7 +203,7 @@ public function testBlockMigration() { 'block_count' => 7, 'feed' => '5', ]; - $this->assertEntity('aggregator', [], 'sidebar_second', 'bartik', -2, $settings); + $this->assertEntity('aggregator', [], 'sidebar', 'olivero', -2, $settings); // Check book block. $settings = [ @@ -213,7 +213,7 @@ public function testBlockMigration() { 'label_display' => '0', 'block_mode' => 'book pages', ]; - $this->assertEntity('book', [], 'sidebar_second', 'bartik', -4, $settings); + $this->assertEntity('book', [], 'sidebar', 'olivero', -4, $settings); // Check forum block settings. $settings = [ @@ -226,7 +226,7 @@ public function testBlockMigration() { 'administrative' => '1', ], ]; - $this->assertEntity('forum', [], 'sidebar_first', 'bartik', -8, $settings); + $this->assertEntity('forum', [], 'sidebar', 'olivero', -8, $settings); $settings = [ 'id' => 'forum_new_block', @@ -238,7 +238,7 @@ public function testBlockMigration() { 'administrative' => '1', ], ]; - $this->assertEntity('forum_1', [], 'sidebar_first', 'bartik', -9, $settings); + $this->assertEntity('forum_1', [], 'sidebar', 'olivero', -9, $settings); // Check statistic block settings. $settings = [ @@ -250,7 +250,7 @@ public function testBlockMigration() { 'top_all_num' => 8, 'top_last_num' => 9, ]; - $this->assertEntity('statistics', [], 'sidebar_second', 'bartik', 0, $settings); + $this->assertEntity('statistics', [], 'sidebar', 'olivero', 0, $settings); // Check custom blocks. $visibility = [ @@ -269,7 +269,7 @@ public function testBlockMigration() { 'info' => '', 'view_mode' => 'full', ]; - $this->assertEntity('block', $visibility, 'content', 'bartik', 0, $settings); + $this->assertEntity('block', $visibility, 'content', 'olivero', 0, $settings); $visibility = [ 'request_path' => [ diff --git a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php index 0e0117e8b25779e9bca56d7f221df632ace918cb..2b65a98f582ec575e36af0be28356e650c9d3089 100644 --- a/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php +++ b/core/modules/block/tests/src/Kernel/Migrate/d7/MigrateBlockTest.php @@ -36,15 +36,15 @@ protected function setUp(): void { parent::setUp(); // Install the themes used for this test. - $this->container->get('theme_installer')->install(['bartik', 'seven']); - $this->installEntitySchema('block_content'); + $this->container->get('theme_installer')->install(['olivero', 'claro']); + $this->installConfig(static::$modules); - // Set Bartik and Seven as the default public and admin theme. + // Set Olivero and Claro as the default public and admin theme. $config = $this->config('system.theme'); - $config->set('default', 'bartik'); - $config->set('admin', 'seven'); + $config->set('default', 'olivero'); + $config->set('admin', 'claro'); $config->save(); $this->executeMigrations([ @@ -113,18 +113,18 @@ public function assertEntity(string $id, string $plugin_id, array $roles, string * Tests the block migration. */ public function testBlockMigration() { - $this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'bartik', 0, '', '0'); - $this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'sidebar_first', 'bartik', -1, '', '0'); - $this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'sidebar_first', 'bartik', 0, 'User login title', 'visible'); - $this->assertEntity('bartik_system_powered_by', 'system_powered_by_block', [], '', 'footer_fifth', 'bartik', 10, '', '0'); - $this->assertEntity('seven_system_main', 'system_main_block', [], '', 'content', 'seven', 0, '', '0'); - $this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'seven', 10, 'User login title', 'visible'); + $this->assertEntity('bartik_system_main', 'system_main_block', [], '', 'content', 'olivero', 0, '', '0'); + $this->assertEntity('bartik_search_form', 'search_form_block', [], '', 'content', 'olivero', -1, '', '0'); + $this->assertEntity('bartik_user_login', 'user_login_block', [], '', 'content', 'olivero', 0, 'User login title', 'visible'); + $this->assertEntity('bartik_system_powered_by', 'system_powered_by_block', [], '', 'footer_bottom', 'olivero', 10, '', '0'); + $this->assertEntity('seven_system_main', 'system_main_block', [], '', 'content', 'claro', 0, '', '0'); + $this->assertEntity('seven_user_login', 'user_login_block', [], '', 'content', 'claro', 10, 'User login title', 'visible'); // The d7_custom_block migration should have migrated a block containing a // mildly amusing limerick. We'll need its UUID to determine // bartik_block_1's plugin ID. $uuid = BlockContent::load(1)->uuid(); - $this->assertEntity('bartik_block_1', 'block_content:' . $uuid, ['authenticated'], '', 'highlighted', 'bartik', 0, 'Mildly amusing limerick of the day', 'visible'); + $this->assertEntity('bartik_block_1', 'block_content:' . $uuid, ['authenticated'], '', 'content', 'olivero', 0, 'Mildly amusing limerick of the day', 'visible'); // Assert that disabled blocks (or enabled blocks whose plugin IDs could // be resolved) did not migrate. diff --git a/core/modules/system/migrations/d7_theme_settings.yml b/core/modules/system/migrations/d7_theme_settings.yml index ad789fae8a9f4cb5a888529512f5c05bdd822e9b..ef08585eb6d8e3be9fa6f48fcfd4cfc2581d2c04 100644 --- a/core/modules/system/migrations/d7_theme_settings.yml +++ b/core/modules/system/migrations/d7_theme_settings.yml @@ -10,7 +10,7 @@ source: process: # Build the configuration name from the variable name, i.e. # theme_bartik_settings becomes bartik.settings. - theme_name: + legacy_theme_name: - plugin: explode source: name @@ -19,6 +19,13 @@ process: plugin: extract index: - 1 + theme_name: + plugin: static_map + source: '@legacy_theme_name' + bypass: true + map: + bartik: olivero + seven: claro configuration_name: plugin: concat source: diff --git a/core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php b/core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php index 511cec9cedd52b304c36b149d7915677919d492d..ee1567457d9aeb5bbb1241b2f0950ac47f12839c 100644 --- a/core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php +++ b/core/modules/system/src/Plugin/migrate/destination/d7/ThemeSettings.php @@ -67,6 +67,7 @@ public function import(Row $row, array $old_destination_id_values = []) { // Remove keys not in theme settings. unset($theme_settings['configuration_name']); unset($theme_settings['theme_name']); + unset($theme_settings['legacy_theme_name']); if (isset($theme_settings)) { theme_settings_convert_to_config($theme_settings, $config); $config->save(); diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php index f1c77017fe707c53e5b4fa8515d448b6ee2e66ea..4faf6273271187a9e8f81987efd9b00db91ae830 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateThemeSettingsTest.php @@ -17,8 +17,8 @@ class MigrateThemeSettingsTest extends MigrateDrupal7TestBase { protected function setUp(): void { parent::setUp(); - // Install bartik and seven themes. - \Drupal::service('theme_installer')->install(['bartik', 'seven']); + // Install Olivero and Claro themes. + \Drupal::service('theme_installer')->install(['olivero', 'claro']); $this->executeMigration('d7_theme_settings'); } @@ -26,7 +26,7 @@ protected function setUp(): void { * Tests migration of theme settings to variables to configuration. */ public function testMigrateThemeSettings() { - $config = $this->config('bartik.settings'); + $config = $this->config('olivero.settings'); $this->assertSame('', $config->get('favicon.path')); $this->assertTrue($config->get('favicon.use_default')); @@ -40,7 +40,7 @@ public function testMigrateThemeSettings() { $this->assertSame('public://gnu.png', $config->get('logo.path')); $this->assertFalse($config->get('logo.use_default')); - $config = $this->config('seven.settings'); + $config = $this->config('claro.settings'); $this->assertSame('', $config->get('favicon.path')); $this->assertTrue($config->get('favicon.use_default')); $this->assertFalse($config->get('features.comment_user_picture'));