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 6d1f398..20b3fe6 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 @@ -4,6 +4,10 @@ migration_groups: - Drupal 6 source: plugin: d6_block + constants: + request_path: request_path + user_role: user_role + current_user: 'user.current_user' process: # Drupal 8 does not have a status but it doesn't matter; this is here to # skip disabled blocks. @@ -79,8 +83,12 @@ process: - delta - settings - visibility - 'settings/visibility/request_path/pages': pages - 'settings/visibility/user_role/roles': roles + 'visibility/request_path/pages': pages + 'visibility/request_path/id': 'constants/request_path' + # @todo Need to cast to empty array if empty and not NULL as it is now... + 'visibility/user_role/roles': roles + 'visibility/user_role/id': 'constants/user_role' + 'visibility/user_role/context_mapping/user': 'constants/current_user' destination: plugin: entity:block migration_dependencies: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_promote.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_promote.yml index b2b3cc8..6230024 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_promote.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_promote.yml @@ -11,7 +11,7 @@ process: entity_type: 'constants/entity_type' bundle: type field_name: 'constants/field_name' - default_value: 'options/promote' + 'default_value/0/value': 'options/promote' destination: plugin: entity:base_field_override migration_dependencies: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_status.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_status.yml index adb2a7d..db275bc 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_status.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_status.yml @@ -11,7 +11,7 @@ process: entity_type: 'constants/entity_type' bundle: type field_name: 'constants/field_name' - default_value: 'options/status' + 'default_value/0/value': 'options/status' destination: plugin: entity:base_field_override migration_dependencies: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_sticky.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_sticky.yml index 988a0ac..3636d57 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_sticky.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_setting_sticky.yml @@ -11,7 +11,7 @@ process: entity_type: 'constants/entity_type' bundle: type field_name: 'constants/field_name' - default_value: 'options/sticky' + 'default_value/0/value': 'options/sticky' destination: plugin: entity:base_field_override migration_dependencies: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_cron.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_cron.yml index 68c7d39..61953b4 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_cron.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_cron.yml @@ -9,8 +9,8 @@ source: - cron_threshold_error - cron_last process: - 'threshold/warning': cron_threshold_warning - 'threshold/error': cron_threshold_error + 'threshold/requirements_warning': cron_threshold_warning + 'threshold/requirements_error': cron_threshold_error destination: plugin: config config_name: system.cron diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_entity_form_display.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_entity_form_display.yml index 5c31190..f19d033 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_entity_form_display.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_entity_form_display.yml @@ -11,7 +11,6 @@ source: name: upload type: file_generic options: - label: hidden settings: progress_indicator: throbber process: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_entity_form_display.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_entity_form_display.yml index 7d6def4..e09b608 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_entity_form_display.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_entity_form_display.yml @@ -9,8 +9,6 @@ source: entity_type: user bundle: user form_mode: default - options: - label: hidden process: entity_type: 'constants/entity_type' bundle: 'constants/bundle' diff --git a/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml b/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml index e28173f..7533ea6 100644 --- a/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml +++ b/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml @@ -275,6 +275,24 @@ migrate.source.d6_user_picture_instance: type: migrate_entity_constant label: 'Constants' +migrate.source.d6_block: + type: migrate_source + label: 'Drupal 6 menu link' + mapping: + constants: + type: mapping + label: 'Constants' + mapping: + user_role: + type: string + label: 'User role plugin ID' + request_path: + type: string + label: 'Request path plugin ID' + current_user: + type: string + label: 'Current user context identifier' + migrate_entity_constant: type: mapping mapping: diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php index df317dc..d449240 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php @@ -26,7 +26,8 @@ class BlockSettings extends ProcessPluginBase { public function transform($value, MigrateExecutable $migrate_executable, Row $row, $destination_property) { list($plugin, $delta, $old_settings, $visibility) = $value; $settings = array(); - $settings['visibility']['request_path']['negate'] = !$visibility; + // @todo this needs to be set OUTSDIE of $settings, not sure how? + //$settings['visibility']['request_path']['negate'] = !$visibility; switch ($plugin) { case 'aggregator_feed_block': list(, $id) = explode('-', $delta); diff --git a/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php b/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php index 91e20ff..3538267 100644 --- a/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php @@ -15,6 +15,15 @@ abstract class MigrateDrupalTestBase extends MigrateTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php index a9afa6b..2bc8216 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php @@ -37,8 +37,8 @@ protected function setUp() { */ public function testSystemCron() { $config = \Drupal::config('system.cron'); - $this->assertIdentical($config->get('threshold.warning'), 172800); - $this->assertIdentical($config->get('threshold.error'), 1209600); + $this->assertIdentical($config->get('threshold.requirements_warning'), 172800); + $this->assertIdentical($config->get('threshold.requirements_error'), 1209600); } }