Problem/Motivation

In Drupal 9, not run migration of migrate_example.

Steps to reproduce

  1. Install migration_example and migration_tool
  2. 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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pabloveintimilla created an issue. See original summary.

pabloveintimilla’s picture

Assigned: Unassigned » pabloveintimilla
pabloveintimilla’s picture

pabloveintimilla’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB
damienmckenna’s picture

Assigned: pabloveintimilla » Unassigned
jvogt’s picture

Here's a patch that replaces the other functional instance of dedupe_entity as well.

matroskeen’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks 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_example module.

danflanagan8’s picture

@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.

matroskeen’s picture

Version: 8.x-5.1 » 8.x-5.x-dev
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new2.03 KB

Attaching a test-only patch.

Status: Needs review » Needs work

The last submitted patch, 10: 3223182-10-test.patch, failed testing. View results

matroskeen’s picture

Status: Needs work » Needs review

MR 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:

matroskeen’s picture

I learned about config/schema/migrate_plus.process.schema.yml file 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.

danflanagan8’s picture

Status: Needs review » Reviewed & tested by the community

Nice 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!

heddn made their first commit to this issue’s fork.

  • heddn committed d1400d7 on 8.x-5.x authored by Matroskeen
    Issue #3223182: The "dedupe_entity" plugin does not exist
    
heddn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the test and work here. Much appreciated.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.