diff --git a/core/modules/action/migration_templates/action_settings.yml b/core/modules/action/migration_templates/action_settings.yml index df69e33b60..4aca21a635 100644 --- a/core/modules/action/migration_templates/action_settings.yml +++ b/core/modules/action/migration_templates/action_settings.yml @@ -7,6 +7,7 @@ source: plugin: variable variables: - actions_max_stack + provider: action process: recursion_limit: actions_max_stack destination: diff --git a/core/modules/aggregator/migration_templates/d6_aggregator_settings.yml b/core/modules/aggregator/migration_templates/d6_aggregator_settings.yml index 72372e4093..12abfd51f9 100644 --- a/core/modules/aggregator/migration_templates/d6_aggregator_settings.yml +++ b/core/modules/aggregator/migration_templates/d6_aggregator_settings.yml @@ -12,6 +12,7 @@ source: - aggregator_teaser_length - aggregator_clear - aggregator_summary_items + provider: aggregator process: fetcher: aggregator_fetcher parser: aggregator_parser diff --git a/core/modules/aggregator/migration_templates/d7_aggregator_settings.yml b/core/modules/aggregator/migration_templates/d7_aggregator_settings.yml index c8c793fdd1..229dd01714 100644 --- a/core/modules/aggregator/migration_templates/d7_aggregator_settings.yml +++ b/core/modules/aggregator/migration_templates/d7_aggregator_settings.yml @@ -12,6 +12,7 @@ source: - aggregator_teaser_length - aggregator_clear - aggregator_summary_items + provider: aggregator process: fetcher: aggregator_fetcher parser: aggregator_parser diff --git a/core/modules/block_content/migration_templates/block_content_body_field.yml b/core/modules/block_content/migration_templates/block_content_body_field.yml index b51d032168..113fb9810e 100644 --- a/core/modules/block_content/migration_templates/block_content_body_field.yml +++ b/core/modules/block_content/migration_templates/block_content_body_field.yml @@ -19,6 +19,7 @@ source: type: string field_name: type: string + provider: block process: entity_type: entity_type bundle: bundle diff --git a/core/modules/block_content/migration_templates/block_content_type.yml b/core/modules/block_content/migration_templates/block_content_type.yml index bc75eeac47..77ae99d9a3 100644 --- a/core/modules/block_content/migration_templates/block_content_type.yml +++ b/core/modules/block_content/migration_templates/block_content_type.yml @@ -12,6 +12,7 @@ source: ids: id: type: string + provider: block process: id: id label: label diff --git a/core/modules/block_content/src/Plugin/migrate/source/d6/Box.php b/core/modules/block_content/src/Plugin/migrate/source/d6/Box.php index a28927bd58..65c09406a8 100644 --- a/core/modules/block_content/src/Plugin/migrate/source/d6/Box.php +++ b/core/modules/block_content/src/Plugin/migrate/source/d6/Box.php @@ -8,7 +8,8 @@ * Drupal 6 block source from database. * * @MigrateSource( - * id = "d6_box" + * id = "d6_box", + * source_provider = "block" * ) */ class Box extends DrupalSqlBase { diff --git a/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php b/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php index ea336829bf..edd6563bfe 100644 --- a/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php +++ b/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php @@ -8,7 +8,8 @@ * Drupal 7 custom block source from database. * * @MigrateSource( - * id = "d7_block_custom" + * id = "d7_block_custom", + * source_provider = "block" * ) */ class BlockCustom extends DrupalSqlBase { diff --git a/core/modules/book/migration_templates/d6_book_settings.yml b/core/modules/book/migration_templates/d6_book_settings.yml index 16e6695398..8b7b377d0b 100644 --- a/core/modules/book/migration_templates/d6_book_settings.yml +++ b/core/modules/book/migration_templates/d6_book_settings.yml @@ -8,6 +8,7 @@ source: - book_child_type - book_block_mode - book_allowed_types + provider: book process: child_type: book_child_type 'block/navigation/mode': book_block_mode diff --git a/core/modules/book/src/Plugin/migrate/source/d6/Book.php b/core/modules/book/src/Plugin/migrate/source/d6/Book.php index f41bb42dfa..dc43fb04f2 100644 --- a/core/modules/book/src/Plugin/migrate/source/d6/Book.php +++ b/core/modules/book/src/Plugin/migrate/source/d6/Book.php @@ -8,7 +8,8 @@ * Drupal 6 book source. * * @MigrateSource( - * id = "d6_book" + * id = "d6_book", + * source_provider = "book" * ) */ class Book extends DrupalSqlBase { diff --git a/core/modules/comment/migration_templates/d6_comment_entity_display.yml b/core/modules/comment/migration_templates/d6_comment_entity_display.yml index c650673188..c07ccccf3c 100644 --- a/core/modules/comment/migration_templates/d6_comment_entity_display.yml +++ b/core/modules/comment/migration_templates/d6_comment_entity_display.yml @@ -12,6 +12,7 @@ source: label: hidden type: comment_default weight: 20 + provider: comment process: entity_type: 'constants/entity_type' field_name: 'constants/field_name' diff --git a/core/modules/comment/migration_templates/d6_comment_entity_form_display.yml b/core/modules/comment/migration_templates/d6_comment_entity_form_display.yml index c33685feb6..dab38e4ce2 100644 --- a/core/modules/comment/migration_templates/d6_comment_entity_form_display.yml +++ b/core/modules/comment/migration_templates/d6_comment_entity_form_display.yml @@ -11,6 +11,7 @@ source: options: type: comment_default weight: 20 + provider: comment process: entity_type: 'constants/entity_type' field_name: 'constants/field_name' diff --git a/core/modules/comment/migration_templates/d6_comment_entity_form_display_subject.yml b/core/modules/comment/migration_templates/d6_comment_entity_form_display_subject.yml index abe6191b8c..e05a7579a9 100644 --- a/core/modules/comment/migration_templates/d6_comment_entity_form_display_subject.yml +++ b/core/modules/comment/migration_templates/d6_comment_entity_form_display_subject.yml @@ -11,6 +11,7 @@ source: options: type: string_textfield weight: 10 + provider: comment process: entity_type: 'constants/entity_type' field_name: 'constants/field_name' diff --git a/core/modules/comment/migration_templates/d6_comment_field.yml b/core/modules/comment/migration_templates/d6_comment_field.yml index d14d1aa4fc..3a9a4057a7 100644 --- a/core/modules/comment/migration_templates/d6_comment_field.yml +++ b/core/modules/comment/migration_templates/d6_comment_field.yml @@ -7,6 +7,7 @@ source: constants: entity_type: node type: comment + provider: comment process: entity_type: 'constants/entity_type' field_name: comment_type diff --git a/core/modules/comment/migration_templates/d6_comment_field_instance.yml b/core/modules/comment/migration_templates/d6_comment_field_instance.yml index d708619e1e..f7151998a7 100644 --- a/core/modules/comment/migration_templates/d6_comment_field_instance.yml +++ b/core/modules/comment/migration_templates/d6_comment_field_instance.yml @@ -8,6 +8,7 @@ source: entity_type: node label: Comments required: true + provider: comment process: entity_type: 'constants/entity_type' label: 'constants/label' diff --git a/core/modules/comment/migration_templates/d6_comment_type.yml b/core/modules/comment/migration_templates/d6_comment_type.yml index 69a2bd8651..2f5fbcbb37 100644 --- a/core/modules/comment/migration_templates/d6_comment_type.yml +++ b/core/modules/comment/migration_templates/d6_comment_type.yml @@ -6,6 +6,7 @@ source: plugin: d6_comment_variable_per_comment_type constants: entity_type: node + provider: comment process: target_entity_type_id: 'constants/entity_type' id: comment_type diff --git a/core/modules/config_translation/migration_templates/d6_i18n_system_maintenance.yml b/core/modules/config_translation/migration_templates/d6_i18n_system_maintenance.yml index 1c99961cc8..f1c4c7ec3e 100644 --- a/core/modules/config_translation/migration_templates/d6_i18n_system_maintenance.yml +++ b/core/modules/config_translation/migration_templates/d6_i18n_system_maintenance.yml @@ -6,6 +6,7 @@ source: plugin: i18n_variable variables: - site_offline_message + provider: system process: langcode: language message: site_offline_message diff --git a/core/modules/config_translation/migration_templates/d6_i18n_system_site.yml b/core/modules/config_translation/migration_templates/d6_i18n_system_site.yml index 3c80821337..148e757599 100644 --- a/core/modules/config_translation/migration_templates/d6_i18n_system_site.yml +++ b/core/modules/config_translation/migration_templates/d6_i18n_system_site.yml @@ -13,6 +13,7 @@ source: - site_frontpage - site_403 - site_404 + provider: system process: langcode: language name: site_name diff --git a/core/modules/config_translation/migration_templates/d6_i18n_user_mail.yml b/core/modules/config_translation/migration_templates/d6_i18n_user_mail.yml index d1e5db501b..bae575dea9 100644 --- a/core/modules/config_translation/migration_templates/d6_i18n_user_mail.yml +++ b/core/modules/config_translation/migration_templates/d6_i18n_user_mail.yml @@ -19,6 +19,7 @@ source: - user_mail_register_pending_approval_body - user_mail_status_blocked_subject - user_mail_status_blocked_body + provider: system process: langcode: language 'status_activated/subject': diff --git a/core/modules/config_translation/migration_templates/d6_i18n_user_settings.yml b/core/modules/config_translation/migration_templates/d6_i18n_user_settings.yml index 36b0fa6c88..11c7c165b9 100644 --- a/core/modules/config_translation/migration_templates/d6_i18n_user_settings.yml +++ b/core/modules/config_translation/migration_templates/d6_i18n_user_settings.yml @@ -10,6 +10,7 @@ source: - user_email_verification - user_register - anonymous + provider: system process: langcode: language 'notify/status_blocked': user_mail_status_blocked_notify diff --git a/core/modules/dblog/migration_templates/d6_dblog_settings.yml b/core/modules/dblog/migration_templates/d6_dblog_settings.yml index 64da0a7d13..afa1e53491 100644 --- a/core/modules/dblog/migration_templates/d6_dblog_settings.yml +++ b/core/modules/dblog/migration_templates/d6_dblog_settings.yml @@ -6,8 +6,10 @@ source: plugin: variable variables: - dblog_row_limit + provider: dblog process: row_limit: dblog_row_limit destination: plugin: config config_name: dblog.settings + provider: dblog diff --git a/core/modules/dblog/migration_templates/d7_dblog_settings.yml b/core/modules/dblog/migration_templates/d7_dblog_settings.yml index e22768fe46..b2dbfb27bf 100644 --- a/core/modules/dblog/migration_templates/d7_dblog_settings.yml +++ b/core/modules/dblog/migration_templates/d7_dblog_settings.yml @@ -6,8 +6,10 @@ source: plugin: variable variables: - dblog_row_limit + provider: dblog process: row_limit: dblog_row_limit destination: plugin: config config_name: dblog.settings + provider: dblog diff --git a/core/modules/field/migration_templates/d7_field.yml b/core/modules/field/migration_templates/d7_field.yml index 15079d8816..726fa465f3 100644 --- a/core/modules/field/migration_templates/d7_field.yml +++ b/core/modules/field/migration_templates/d7_field.yml @@ -9,6 +9,7 @@ source: constants: status: true langcode: und + provider: field process: entity_type: entity_type status: 'constants/status' 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 b5ee417010..37a692301c 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 @@ -9,6 +9,7 @@ source: constants: form_mode: default third_party_settings: { } + provider: field process: # We skip field types that don't exist because they weren't migrated by the # field migration. diff --git a/core/modules/field/migration_templates/d7_view_modes.yml b/core/modules/field/migration_templates/d7_view_modes.yml index fd17138275..aca872b1ef 100644 --- a/core/modules/field/migration_templates/d7_view_modes.yml +++ b/core/modules/field/migration_templates/d7_view_modes.yml @@ -4,6 +4,7 @@ migration_tags: - Drupal 7 source: plugin: d7_view_mode + provider: field process: mode: plugin: static_map diff --git a/core/modules/file/migration_templates/d6_file.yml b/core/modules/file/migration_templates/d6_file.yml index 8371d45f10..9121a114ab 100644 --- a/core/modules/file/migration_templates/d6_file.yml +++ b/core/modules/file/migration_templates/d6_file.yml @@ -12,6 +12,7 @@ source: # table are specified, and must end with a /. See source_full_path # configuration in this migration's process pipeline as an example. source_base_path: '' + provider: system process: # If you are using both this migration and d6_user_picture_file in a custom # migration and executing migrations incrementally, it is strongly diff --git a/core/modules/file/migration_templates/d6_upload_field.yml b/core/modules/file/migration_templates/d6_upload_field.yml index a919f918ff..3191be65d7 100644 --- a/core/modules/file/migration_templates/d6_upload_field.yml +++ b/core/modules/file/migration_templates/d6_upload_field.yml @@ -13,6 +13,7 @@ source: name: upload cardinality: -1 display_field: true + provider: upload process: entity_type: 'constants/entity_type' field_name: 'constants/name' diff --git a/core/modules/file/migration_templates/d7_file.yml b/core/modules/file/migration_templates/d7_file.yml index 7b35aff9c8..ac6fd58d61 100644 --- a/core/modules/file/migration_templates/d7_file.yml +++ b/core/modules/file/migration_templates/d7_file.yml @@ -12,6 +12,7 @@ source: # table are specified, and must end with a /. See source_full_path # configuration in this migration's process pipeline as an example. source_base_path: '' + provider: file process: # If you are using this file to build a custom migration consider removing # the fid field to allow incremental migrations. diff --git a/core/modules/file/migration_templates/file_settings.yml b/core/modules/file/migration_templates/file_settings.yml index 36584ccf8e..422af6dbc8 100644 --- a/core/modules/file/migration_templates/file_settings.yml +++ b/core/modules/file/migration_templates/file_settings.yml @@ -9,6 +9,7 @@ source: - file_description_type - file_description_length - file_icon_directory + provider: system process: 'description/type': file_description_type 'description/length': file_description_length @@ -16,3 +17,4 @@ process: destination: plugin: config config_name: file.settings + provider: file diff --git a/core/modules/filter/migration_templates/d6_filter_format.yml b/core/modules/filter/migration_templates/d6_filter_format.yml index a5f438862c..9346be93bc 100644 --- a/core/modules/filter/migration_templates/d6_filter_format.yml +++ b/core/modules/filter/migration_templates/d6_filter_format.yml @@ -4,6 +4,7 @@ migration_tags: - Drupal 6 source: plugin: d6_filter_format + provider: filter process: format: plugin: machine_name diff --git a/core/modules/filter/migration_templates/d7_filter_format.yml b/core/modules/filter/migration_templates/d7_filter_format.yml index c0710b5f07..5a4902643e 100644 --- a/core/modules/filter/migration_templates/d7_filter_format.yml +++ b/core/modules/filter/migration_templates/d7_filter_format.yml @@ -4,6 +4,7 @@ migration_tags: - Drupal 7 source: plugin: d7_filter_format + provider: filter process: format: format name: name diff --git a/core/modules/filter/migration_templates/d7_filter_settings.yml b/core/modules/filter/migration_templates/d7_filter_settings.yml index d6239fc2e0..b71065eeb3 100644 --- a/core/modules/filter/migration_templates/d7_filter_settings.yml +++ b/core/modules/filter/migration_templates/d7_filter_settings.yml @@ -6,6 +6,7 @@ source: plugin: variable variables: - filter_fallback_format + provider: filter process: fallback_format: filter_fallback_format destination: diff --git a/core/modules/forum/migration_templates/d6_forum_settings.yml b/core/modules/forum/migration_templates/d6_forum_settings.yml index 5516848e42..dfb8be46e5 100644 --- a/core/modules/forum/migration_templates/d6_forum_settings.yml +++ b/core/modules/forum/migration_templates/d6_forum_settings.yml @@ -11,6 +11,7 @@ source: - forum_block_num_0 - forum_block_num_1 - forum_nav_vocabulary + provider: forum process: 'block/active/limit': forum_block_num_0 'block/new/limit': forum_block_num_1 diff --git a/core/modules/forum/migration_templates/d7_forum_settings.yml b/core/modules/forum/migration_templates/d7_forum_settings.yml index b84d485989..1656420b61 100644 --- a/core/modules/forum/migration_templates/d7_forum_settings.yml +++ b/core/modules/forum/migration_templates/d7_forum_settings.yml @@ -11,6 +11,7 @@ source: - forum_block_num_active - forum_block_num_new - forum_nav_vocabulary + provider: forum process: 'block/active/limit': forum_block_num_active 'block/new/limit': forum_block_num_new diff --git a/core/modules/image/migration_templates/d7_image_settings.yml b/core/modules/image/migration_templates/d7_image_settings.yml index bfae4d5bb5..d2223fe2a8 100644 --- a/core/modules/image/migration_templates/d7_image_settings.yml +++ b/core/modules/image/migration_templates/d7_image_settings.yml @@ -8,6 +8,7 @@ source: - allow_insecure_derivatives - suppress_itok_output - image_style_preview_image + provider: image process: suppress_itok_output: suppress_itok_output allow_insecure_derivatives: allow_insecure_derivatives diff --git a/core/modules/language/migration_templates/d6_language_content_settings.yml b/core/modules/language/migration_templates/d6_language_content_settings.yml index 3bf9078ef0..42e041b9d3 100644 --- a/core/modules/language/migration_templates/d6_language_content_settings.yml +++ b/core/modules/language/migration_templates/d6_language_content_settings.yml @@ -7,6 +7,7 @@ source: plugin: d6_language_content_settings constants: target_type: 'node' + provider: locale process: # Ignore i18n_node_options_[node_type] options not available in Drupal 8, # i18n_required_node and i18n_newnode_current diff --git a/core/modules/language/migration_templates/d6_language_negotiation_settings.yml b/core/modules/language/migration_templates/d6_language_negotiation_settings.yml index abc71f68f9..ee02902a1c 100644 --- a/core/modules/language/migration_templates/d6_language_negotiation_settings.yml +++ b/core/modules/language/migration_templates/d6_language_negotiation_settings.yml @@ -6,6 +6,7 @@ source: plugin: variable variables: - language_negotiation + provider: language process: session/parameter: plugin: default_value diff --git a/core/modules/language/migration_templates/d6_language_types.yml b/core/modules/language/migration_templates/d6_language_types.yml index 05ce3001ec..e4403ced6d 100644 --- a/core/modules/language/migration_templates/d6_language_types.yml +++ b/core/modules/language/migration_templates/d6_language_types.yml @@ -6,6 +6,7 @@ source: plugin: variable variables: - language_negotiation + provider: language process: all: plugin: default_value diff --git a/core/modules/language/migration_templates/d7_language_content_settings.yml b/core/modules/language/migration_templates/d7_language_content_settings.yml index 09437fa455..f5f62bde14 100644 --- a/core/modules/language/migration_templates/d7_language_content_settings.yml +++ b/core/modules/language/migration_templates/d7_language_content_settings.yml @@ -6,6 +6,7 @@ source: plugin: d7_language_content_settings constants: target_type: 'node' + provider: locale process: # Ignore i18n_node_options_[node_type] options not available in Drupal 8, # i18n_required_node and i18n_newnode_current diff --git a/core/modules/language/migration_templates/d7_language_negotiation_settings.yml b/core/modules/language/migration_templates/d7_language_negotiation_settings.yml index 7759965336..7b6c52f946 100644 --- a/core/modules/language/migration_templates/d7_language_negotiation_settings.yml +++ b/core/modules/language/migration_templates/d7_language_negotiation_settings.yml @@ -7,6 +7,7 @@ source: variables: - locale_language_negotiation_session_param - locale_language_negotiation_url_part + provider: locale process: session/parameter: plugin: default_value @@ -27,6 +28,7 @@ process: destination: plugin: config config_name: language.negotiation + provider: language migration_dependencies: required: - language diff --git a/core/modules/language/migration_templates/d7_language_types.yml b/core/modules/language/migration_templates/d7_language_types.yml index 3a634a2e65..75f0ea787f 100644 --- a/core/modules/language/migration_templates/d7_language_types.yml +++ b/core/modules/language/migration_templates/d7_language_types.yml @@ -12,6 +12,7 @@ source: - locale_language_providers_weight_language - locale_language_providers_weight_language_content - locale_language_providers_weight_language_url + provider: language process: all: plugin: language_types diff --git a/core/modules/language/migration_templates/default_language.yml b/core/modules/language/migration_templates/default_language.yml index 6d7604deed..8784acb0d7 100644 --- a/core/modules/language/migration_templates/default_language.yml +++ b/core/modules/language/migration_templates/default_language.yml @@ -7,6 +7,7 @@ source: plugin: variable variables: - language_default + provider: locale process: default_langcode: - diff --git a/core/modules/locale/migration_templates/locale_settings.yml b/core/modules/locale/migration_templates/locale_settings.yml index 6eebe20455..f61b8a147a 100644 --- a/core/modules/locale/migration_templates/locale_settings.yml +++ b/core/modules/locale/migration_templates/locale_settings.yml @@ -8,6 +8,7 @@ source: variables: - locale_cache_strings - locale_js_directory + provider: locale process: cache_strings: locale_cache_strings 'javascript/directory': locale_js_directory diff --git a/core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php b/core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php index 338d3ecef9..dd87ee7371 100644 --- a/core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php +++ b/core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php @@ -11,6 +11,7 @@ * * @MigrateSource( * id = "menu_link", + * source_provider = "menu" * ) */ class MenuLink extends DrupalSqlBase { diff --git a/core/modules/menu_ui/migration_templates/menu_settings.yml b/core/modules/menu_ui/migration_templates/menu_settings.yml index dee5f9ee6c..70d2ca4c75 100644 --- a/core/modules/menu_ui/migration_templates/menu_settings.yml +++ b/core/modules/menu_ui/migration_templates/menu_settings.yml @@ -8,8 +8,10 @@ source: plugin: variable variables: - menu_override_parent_selector + provider: menu process: override_parent_selector: menu_override_parent_selector destination: plugin: config config_name: menu_ui.settings + provider: menu_ui diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 29b1484755..61bc480146 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -21,654 +21,6 @@ class MigrateUpgradeForm extends ConfirmFormBase { use MigrationConfigurationTrait; /** - * Mapping of known migrations and their source and destination modules. - * - * @todo https://www.drupal.org/node/2569805 Hardcoding this information is - * not robust - the migrations themselves should hold the necessary - * information. - * - * @var array[] - */ - protected $moduleUpgradePaths = [ - 'action_settings' => [ - 'source_module' => 'system', - 'destination_module' => 'action', - ], - 'd6_aggregator_feed' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd6_aggregator_item' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd6_aggregator_settings' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd7_aggregator_feed' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd7_aggregator_item' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd7_aggregator_settings' => [ - 'source_module' => 'aggregator', - 'destination_module' => 'aggregator', - ], - 'd7_blocked_ips' => [ - 'source_module' => 'system', - 'destination_module' => 'ban', - ], - 'd6_block' => [ - 'source_module' => 'block', - 'destination_module' => 'block', - ], - 'd7_block' => [ - 'source_module' => 'block', - 'destination_module' => 'block', - ], - 'block_content_entity_form_display' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'block_content_entity_display' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'block_content_body_field' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'block_content_type' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'd6_custom_block' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'd7_custom_block' => [ - 'source_module' => 'block', - 'destination_module' => 'block_content', - ], - 'd6_book' => [ - 'source_module' => 'book', - 'destination_module' => 'book', - ], - 'd6_book_settings' => [ - 'source_module' => 'book', - 'destination_module' => 'book', - ], - 'd6_comment' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_entity_display' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_entity_form_display' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_entity_form_display_subject' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_field' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_field_instance' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd6_comment_type' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_entity_display' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_entity_form_display' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_entity_form_display_subject' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_field' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_field_instance' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'd7_comment_type' => [ - 'source_module' => 'comment', - 'destination_module' => 'comment', - ], - 'contact_category' => [ - 'source_module' => 'contact', - 'destination_module' => 'contact', - ], - 'd6_contact_settings' => [ - 'source_module' => 'contact', - 'destination_module' => 'contact', - ], - 'd7_contact_settings' => [ - 'source_module' => 'contact', - 'destination_module' => 'contact', - ], - 'd6_dblog_settings' => [ - 'source_module' => 'dblog', - 'destination_module' => 'dblog', - ], - 'd7_dblog_settings' => [ - 'source_module' => 'dblog', - 'destination_module' => 'dblog', - ], - 'default_language' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd6_field' => [ - 'source_module' => 'content', - 'destination_module' => 'field', - ], - 'd6_field_formatter_settings' => [ - 'source_module' => 'content', - 'destination_module' => 'field', - ], - 'd6_field_instance' => [ - 'source_module' => 'content', - 'destination_module' => 'field', - ], - 'd6_field_instance_widget_settings' => [ - 'source_module' => 'content', - 'destination_module' => 'field', - ], - 'd7_field' => [ - 'source_module' => 'field', - 'destination_module' => 'field', - ], - 'd7_field_formatter_settings' => [ - 'source_module' => 'field', - 'destination_module' => 'field', - ], - 'd7_field_instance' => [ - 'source_module' => 'field', - 'destination_module' => 'field', - ], - 'd7_field_instance_widget_settings' => [ - 'source_module' => 'field', - 'destination_module' => 'field', - ], - 'd7_view_modes' => [ - 'source_module' => 'field', - 'destination_module' => 'field', - ], - 'd6_file' => [ - 'source_module' => 'system', - 'destination_module' => 'file', - ], - 'file_settings' => [ - 'source_module' => 'system', - 'destination_module' => 'file', - ], - 'd6_upload' => [ - 'source_module' => 'upload', - 'destination_module' => 'file', - ], - 'd6_upload_entity_display' => [ - 'source_module' => 'upload', - 'destination_module' => 'file', - ], - 'd6_upload_entity_form_display' => [ - 'source_module' => 'upload', - 'destination_module' => 'file', - ], - 'd6_upload_field' => [ - 'source_module' => 'upload', - 'destination_module' => 'file', - ], - 'd6_upload_field_instance' => [ - 'source_module' => 'upload', - 'destination_module' => 'file', - ], - 'd7_file' => [ - 'source_module' => 'file', - 'destination_module' => 'file', - ], - 'd6_filter_format' => [ - 'source_module' => 'filter', - 'destination_module' => 'filter', - ], - 'd7_filter_format' => [ - 'source_module' => 'filter', - 'destination_module' => 'filter', - ], - 'd7_filter_settings' => [ - 'source_module' => 'filter', - 'destination_module' => 'filter', - ], - 'd6_forum_settings' => [ - 'source_module' => 'forum', - 'destination_module' => 'forum', - ], - 'd7_forum_settings' => [ - 'source_module' => 'forum', - 'destination_module' => 'forum', - ], - 'd7_global_theme_settings' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_imagecache_presets' => [ - 'source_module' => 'imagecache', - 'destination_module' => 'image', - ], - 'd7_image_settings' => [ - 'source_module' => 'image', - 'destination_module' => 'image', - ], - 'd7_image_styles' => [ - 'source_module' => 'image', - 'destination_module' => 'image', - ], - 'd6_language_content_settings' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd7_language_content_settings' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd6_language_negotiation_settings' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd7_language_negotiation_settings' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'language_prefixes_and_domains' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd6_language_types' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'language' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'd7_language_types' => [ - 'source_module' => 'locale', - 'destination_module' => 'language', - ], - 'locale_settings' => [ - 'source_module' => 'locale', - 'destination_module' => 'locale', - ], - 'd6_menu_links' => [ - 'source_module' => 'menu', - 'destination_module' => 'menu_link_content', - ], - 'menu_settings' => [ - 'source_module' => 'menu', - 'destination_module' => 'menu_ui', - ], - 'd7_menu_links' => [ - 'source_module' => 'menu', - 'destination_module' => 'menu_link_content', - ], - 'd6_node' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_translation' => [ - 'source_module' => 'translation', - 'destination_module' => 'content_translation', - ], - 'd6_node_revision' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_setting_promote' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_setting_status' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_setting_sticky' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_settings' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_node_type' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_view_modes' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node_revision' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node_settings' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node_translation' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node_title_label' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd7_node_type' => [ - 'source_module' => 'node', - 'destination_module' => 'node', - ], - 'd6_url_alias' => [ - 'source_module' => 'path', - 'destination_module' => 'path', - ], - 'd7_url_alias' => [ - 'source_module' => 'path', - 'destination_module' => 'path', - ], - 'search_page' => [ - 'source_module' => 'search', - 'destination_module' => 'search', - ], - 'd6_search_settings' => [ - 'source_module' => 'search', - 'destination_module' => 'search', - ], - 'd7_search_settings' => [ - 'source_module' => 'search', - 'destination_module' => 'search', - ], - 'd7_shortcut' => [ - 'source_module' => 'shortcut', - 'destination_module' => 'shortcut', - ], - 'd7_shortcut_set' => [ - 'source_module' => 'shortcut', - 'destination_module' => 'shortcut', - ], - 'd7_shortcut_set_users' => [ - 'source_module' => 'shortcut', - 'destination_module' => 'shortcut', - ], - 'd6_simpletest_settings' => [ - 'source_module' => 'simpletest', - 'destination_module' => 'simpletest', - ], - 'd7_simpletest_settings' => [ - 'source_module' => 'simpletest', - 'destination_module' => 'simpletest', - ], - 'statistics_settings' => [ - 'source_module' => 'statistics', - 'destination_module' => 'statistics', - ], - 'd6_syslog_settings' => [ - 'source_module' => 'syslog', - 'destination_module' => 'syslog', - ], - 'd7_syslog_settings' => [ - 'source_module' => 'syslog', - 'destination_module' => 'syslog', - ], - 'd6_date_formats' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_system_cron' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_system_date' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_system_file' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_image' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_image_gd' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_logging' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_maintenance' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_system_performance' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_rss' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'system_site' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_authorize' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_cron' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_date' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_file' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_mail' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd7_system_performance' => [ - 'source_module' => 'system', - 'destination_module' => 'system', - ], - 'd6_menu' => [ - 'source_module' => 'menu', - 'destination_module' => 'system', - ], - 'd7_menu' => [ - 'source_module' => 'menu', - 'destination_module' => 'system', - ], - 'taxonomy_settings' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_taxonomy_term' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_taxonomy_vocabulary' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_term_node' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_term_node_revision' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_vocabulary_entity_display' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_vocabulary_entity_form_display' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_vocabulary_field' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd6_vocabulary_field_instance' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd7_taxonomy_term' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'd7_taxonomy_vocabulary' => [ - 'source_module' => 'taxonomy', - 'destination_module' => 'taxonomy', - ], - 'text_settings' => [ - 'source_module' => 'text', - 'destination_module' => 'text', - ], - 'd7_tracker_node' => [ - 'source_module' => 'tracker', - 'destination_module' => 'tracker', - ], - 'd7_tracker_settings' => [ - 'source_module' => 'tracker', - 'destination_module' => 'tracker', - ], - 'd7_tracker_user' => [ - 'source_module' => 'tracker', - 'destination_module' => 'tracker', - ], - 'update_settings' => [ - 'source_module' => 'update', - 'destination_module' => 'update', - ], - 'd6_profile_values' => [ - 'source_module' => 'profile', - 'destination_module' => 'user', - ], - 'd6_user' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd6_user_contact_settings' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd6_user_mail' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd6_user_picture_file' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd6_user_role' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd6_user_settings' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd7_user' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd7_user_flood' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd7_user_mail' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'd7_user_role' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'user_picture_entity_display' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'user_picture_entity_form_display' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'user_picture_field' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'user_picture_field_instance' => [ - 'source_module' => 'user', - 'destination_module' => 'user', - ], - 'user_profile_entity_display' => [ - 'source_module' => 'profile', - 'destination_module' => 'user', - ], - 'user_profile_entity_form_display' => [ - 'source_module' => 'profile', - 'destination_module' => 'user', - ], - 'user_profile_field' => [ - 'source_module' => 'profile', - 'destination_module' => 'user', - ], - 'user_profile_field_instance' => [ - 'source_module' => 'profile', - 'destination_module' => 'user', - ], - 'd6_i18n_user_profile_field_instance' => [ - 'source_module' => 'i18n', - 'destination_module' => 'user', - ], - ]; - - /** * The state service. * * @var \Drupal\Core\State\StateInterface @@ -992,6 +344,7 @@ public function validateCredentialForm(array &$form, FormStateInterface $form_st } // Store the retrieved migration IDs in form storage. + $form_state->set('version', $version); $form_state->set('migrations', $migration_array); $form_state->set('source_base_path', $form_state->getValue('source_base_path')); @@ -1040,26 +393,68 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { $form['actions']['submit']['#value'] = $this->t('Perform upgrade'); + $version = $form_state->get('version'); + $migrations = $this->getMigrations('migrate_drupal_' . $version, $version); + $table_data = []; - $system_data = []; - foreach ($form_state->get('migrations') as $migration_id => $migration_label) { - // Fetch the system data at the first opportunity. - if (empty($system_data)) { - $system_data = $form_state->get('system_data'); + foreach ($migrations as $migration) { + $migration_id = $migration->getPluginId(); + + // Determine the source provider, looking in configuration first. The + // source_provider is expected to be the name of module in the source + // database. It is explicitly set in either the migration configuration or + // the source plugin annotation. + $source_configuration = $migration->getSourceConfiguration(); + $source_module = (!empty($source_configuration['provider'])) ? $source_configuration['provider'] : NULL; + if (!$source_module) { + // Get the source_provider from the plugin definition. + $plugin_definition = $migration->getSourcePlugin()->getPluginDefinition(); + $source_module = (!empty($plugin_definition['source_provider'])) ? $plugin_definition['source_provider'] : NULL; + } + if (!$source_module) { + drupal_set_message($this->t('Source provider not found for @migration_id.', ['@migration_id' => $migration_id]), 'error'); + } + + // Determine the destination provider, looking in configuration first. + $destination_configuration = $migration->getDestinationConfiguration(); + $destination_module = (!empty($destination_configuration['provider'])) ? $destination_configuration['provider'] : NULL; + if (!$destination_module) { + $destination_plugin = $migration->getDestinationPlugin(); + if ($destination_plugin->getPluginId() == 'config') { + // For configuration destinations pull out the module name from the + // configuration destination string. + $configuration_destination = (!empty($destination_configuration['config_name'])) ? $destination_configuration['config_name'] : NULL; + if ($configuration_destination) { + $destination_module = explode('.', $configuration_destination, 2)[0]; + } + } + else { + // If not a config destination, the destination module is simply + // the provider of the plugin. + $destination_module = $destination_plugin->getPluginDefinition()['provider']; + } + } + if (!$destination_module) { + drupal_set_message($this->t('Destination provider not found for @migration_id.', ['@migration_id' => $migration_id]), 'error'); } - // Handle derivatives. - list($migration_id,) = explode(':', $migration_id, 2); - $source_module = $this->moduleUpgradePaths[$migration_id]['source_module']; - $destination_module = $this->moduleUpgradePaths[$migration_id]['destination_module']; - $table_data[$source_module][$destination_module][$migration_id] = $migration_label; + if ($source_module && $destination_module) { + $table_data[$source_module][$destination_module][$migration_id] = $migration->label(); + } } + // Sort the table by source module names and within that destination // module names. ksort($table_data); foreach ($table_data as $source_module => $destination_module_info) { ksort($table_data[$source_module]); } + + $system_data = []; + // Fetch the system data at the first opportunity. + if (empty($system_data)) { + $system_data = $form_state->get('system_data'); + } $unmigrated_source_modules = array_diff_key($system_data['module'], $table_data); // Missing migrations. diff --git a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php index b635f2ab22..5baf19d7b4 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php @@ -39,6 +39,7 @@ 'book', 'forum', 'statistics', + 'provider_test', ]; /** @@ -144,6 +145,29 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertResponse(200); $this->assertText('Are you sure?'); + // Ensure we get errors about missing providers. + $this->assertText(t('Source provider not found for provider_no_annotation.')); + $this->assertText(t(' Source provider not found for provider_test.')); + $this->assertText(t('Destination provider not found for provider_test')); + + // Uninstall the module causing the missing provider error messages. + $this->container->get('module_installer')->uninstall(['provider_test'], TRUE); + + // Restart the upgrade process. + $this->drupalGet('/upgrade'); + $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.'); + + $this->drupalPostForm(NULL, [], t('Continue')); + $this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.'); + $this->assertFieldByName('mysql[host]'); + + $this->drupalPostForm(NULL, $edits, t('Review upgrade')); + $this->assertResponse(200); + $this->assertText('Are you sure?'); + // Ensure there are no errors about the missing providers. + $this->assertNoText(t('Source provider not found for provider_no_annotation.')); + $this->assertNoText(t(' Source provider not found for provider_test.')); + $this->assertNoText(t('Destination provider not found for provider_test')); $this->drupalPostForm(NULL, [], t('Perform upgrade')); $this->assertText(t('Congratulations, you upgraded Drupal!')); diff --git a/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_no_annotation.yml b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_no_annotation.yml new file mode 100644 index 0000000000..7cbcec4dec --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_no_annotation.yml @@ -0,0 +1,13 @@ +id: provider_no_annotation +label: Missing source annotation +migration_tags: + - Drupal 6 + - Drupal 7 +source: +# Test plugin without a source_provider annotation + plugin: no_source_provider +process: + message: site_offline_message +destination: + plugin: config + config_name: test.settings diff --git a/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_test.yml b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_test.yml new file mode 100644 index 0000000000..3bb0d7ab9e --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_test.yml @@ -0,0 +1,16 @@ +id: provider_test +label: Missing source and destination provider +migration_tags: + - Drupal 6 + - Drupal 7 +source: + plugin: variable + variables: + - site_offline_message +# Do not add a provider for the test. +process: + message: site_offline_message +destination: + plugin: config +# An empty config_name will not have a destination provider. + config_name: diff --git a/core/modules/migrate_drupal_ui/tests/modules/provider_test/provider_test.info.yml b/core/modules/migrate_drupal_ui/tests/modules/provider_test/provider_test.info.yml new file mode 100644 index 0000000000..8642c6c8c1 --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/provider_test.info.yml @@ -0,0 +1,6 @@ +name: 'Provider missing' +type: module +description: 'Add a migration missing a source and destination and a source plugin missing a source provide.' +package: Testing +version: VERSION +core: 8.x diff --git a/core/modules/migrate_drupal_ui/tests/modules/provider_test/src/Plugin/migrate/source/NoSourceProvider.php b/core/modules/migrate_drupal_ui/tests/modules/provider_test/src/Plugin/migrate/source/NoSourceProvider.php new file mode 100644 index 0000000000..fc4b2c5c1e --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/src/Plugin/migrate/source/NoSourceProvider.php @@ -0,0 +1,31 @@ +