diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml index 9583d69..0631d53 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml @@ -59,6 +59,14 @@ process: - region - theme - @theme + map: + left: sidebar_first + right: sidebar_second + sidebar_first: sidebar_first + sidebar_second: sidebar_second + help: help + header: header + footer: footer label: title 'visibility.path.visibility': visibility 'visibility.path.pages': pages diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockRegion.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockRegion.php index 59b3f4a..6d6807a 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockRegion.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockRegion.php @@ -6,6 +6,7 @@ namespace Drupal\migrate_drupal\Plugin\migrate\Process\d6; +use Drupal\Component\Utility\NestedArray; use Drupal\migrate\MigrateExecutable; use Drupal\migrate\ProcessPluginBase; use Drupal\migrate\Row; @@ -32,17 +33,9 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro // If the source and destination theme are different, assume these mappings work for most // themes (source => destination). - $default_region_map = array( - 'left' => 'sidebar_first', - 'right' => 'sidebar_second', - 'sidebar_first' => 'sidebar_first', - 'sidebar_second' => 'sidebar_second', - 'help' => 'help', - 'header' => 'header', - 'footer' => 'footer', - ); - if (isset($default_region_map[$region])) { - return $default_region_map[$region]; + $new_region = NestedArray::getValue($this->configuration['map'], array($region), $key_exists); + if ($key_exists) { + return $new_region; } // Oh well, we tried. Put the block in the main content region. diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockTheme.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockTheme.php index 9f23703..bad88ef 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockTheme.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Plugin/migrate/process/d6/BlockTheme.php @@ -70,8 +70,9 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro $d8_default_theme = $this->config->get('default'); $d8_admin_theme = $this->config->get('admin'); - // D6 theme and D8 theme are the same - sweet! - if ((strtolower($theme) == strtolower($d8_default_theme)) || (strtolower($theme) == strtolower($d8_admin_theme))) { + // If the source theme exists on the destination, we're good. + $themes = \Drupal::service('theme_handler')->listInfo(); + if (isset($themes[$theme])) { return $theme; }