migration_lookup process plugin can't use specific subset of source keys to use for lookup

Created on 16 April 2018, over 6 years ago
Updated 18 September 2024, 3 months ago

The migration lookup plugin can be used in two ways:

  uid:
    plugin: migration_lookup
    migration: users
    source: author

There's a single source key, and its value is taken from the 'author' value in the row.

  uid:
    plugin: migration_lookup
      migration:
        - users
        - members
      source_ids:
        users:
          - author
        members:
          - id

The plugin will try multiple migrations in turn, and for each migration to lookup, the source is specified for each one.

In both cases, this is a single source key.

However, migrations often have more than one source key.

Because of how lookupDestinationIds() works, the key used by the lookup plugin is assumed to be the first one:

   * @param array $source_id_values
   *   The source identifier keyed values of the records, e.g. ['nid' => 5].
   *   If unkeyed, the first count($source_id_values) keys will be assumed.

What's missing is:

1. The ability to specify multiple source keys
2. The ability to specify specific source keys. E.g. the migration to use as a lookup might have keys alpha, beta, gamma, and in migration needs to look up using the beta key.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Migration 

Last updated 1 day ago

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024