Problem/Motivation
In Drupal 9, not run migration of migrate_example.
Steps to reproduce
- Install migration_example and migration_tool
- Execute: drush mi:import --group=beer
This, throw this error:
In DiscoveryTrait.php line 53:
The "dedupe_entity" plugin does not exist. Valid plugin IDs for Drupal\migrate\Plugin\MigratePluginManager are: block_settings, block_visibility, block_plu
gin_id, block_region, block_theme, d7_field_instance_settings, d7_field_instance_defaults, d7_field_option_translation, d7_field_type_defaults, field_bundl
e, d7_field_settings, d7_field_instance_option_translation, d6_field_field_settings, field_instance_widget_settings, d6_field_instance_defaults, d6_field_o
ption_translation, d6_field_type_defaults, field_formatter_settings_defaults, field_settings, d6_field_instance_option_translation, field_type, process_fie
ld, file_uri, d6_field_file, filter_format_permission, filter_id, filter_settings, d6_imagecache_actions, language_negotiation, content_translation_enabled
_setting, language_types, language_domains, field_link, link_uri, log, route, download, array_build, menu_link_parent, entity_exists, machine_name, get, nu
ll_coalesce, extract, file_copy, callback, default_value, make_unique_entity_field, flatten, migration_lookup, concat, format_date, urlencode, substr, skip
_row_if_not_set, explode, skip_on_empty, static_map, sub_process, skip_on_value, array_pop, dom_str_replace, array_shift, file_blob, dom_apply_styles, dom_
migration_lookup, dom, transliteration, merge, entity_lookup, default_entity_value, multiple_values, str_replace, entity_generate, single_value, node_updat
e_7008, path_set_translated, d6_url_alias_language, timezone, system_update_7000, forum_vocabulary, user_update_8002, convert_tokens, d6_profile_field_opti
on_translation, user_update_7002, user_langcode, profile_field_settings
Proposed resolution
dedupe_entity is deprecated and removed in Drupal 9, check:
https://api.drupal.org/api/drupal/core%21modules%21migrate%21src%21Plugi...
Change dedupe_entity plugin in migrate_example/config/install/migrate_plus.migration.beer_user.yml to use make_unique_entity_field
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
pabloveintimilla commentedComment #3
pabloveintimilla commentedComment #4
pabloveintimilla commentedComment #5
damienmckennaComment #6
jvogt commentedHere's a patch that replaces the other functional instance of dedupe_entity as well.
Comment #7
matroskeenThanks for the patch! Although it fixes the reported issue, it does not guarantee that it won't break once again when some new changes are introduced in Drupal core. We could catch it earlier if we had a test coverage, so I think it's worth adding a test that will run migrations from
migration_examplemodule.Comment #8
danflanagan8@matroskeen, what would you think about creating a follow-up issue related to test coverage?
Currently none of the example modules (
migrate_example,migrate_example_advanced,migrate_json_example) have test coverage. Test coverage for the example modules would be great, but it seems more important to fix this bug ASAP.Comment #10
matroskeenAttaching a test-only patch.
Comment #12
matroskeenMR contains a fix and a new test, therefore it's ready for review. The patch in #10 has test-only.
I also added two follow-ups for other example modules:
Comment #13
matroskeenI learned about
config/schema/migrate_plus.process.schema.ymlfile and will review existing files plugins at some point.At this moment, we don't have config schema for all plugins anyway, but it should be a separate issue as well.
Comment #14
danflanagan8Nice test, @Matroskeen! I had given writing a test a shot and never came close to something as elegant as what you have. Kudos.
And the fix has never been in dispute. This all looks really good. RTBC. Thanks all!
Comment #17
heddnThanks for the test and work here. Much appreciated.