migration_lookup process plugin can't use multiple or specific source keys to use for lookup

Created on 16 April 2018, about 6 years ago
Updated 25 May 2024, about 1 month 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 about 9 hours 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.

Sign in to follow issues

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.69.0 2024