Allow additional conditions in entity_lookup

Created on 11 November 2022, over 2 years ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

The entity_lookup plugin implements a query to search for entities. However, when the source data includes multiple entities with the same name there is no way to provide additional query conditions to distinguish them.

Steps to reproduce

Assume a migration of courses where each course has a node 'Contact'. The source database will have a multitude of nodes titled 'Contact' linked by a field_course_id

Proposed resolution

Allow passing additional conditions in the entity_lookup plugin.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

The entity_lookup allows additional query conditions.

Data model changes

The entity_lookup has a new configuration key 'conditions'

Feature request
Status

RTBC

Version

6.0

Component

Plugins

Created by

🇳🇱Netherlands idebr

Live updates comments and jobs are added and updated live.
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.

  • 🇫🇷France xavier.masson Haute-Normandie

    Thanks for the patch, i can confirm it works !

  • Status changed to Closed: works as designed over 1 year ago
  • heddn Nicaragua

    The entity lookup process plugin was written to be extended. Adding a custom process plugin is relatively easy. While this is a pretty well tested and easy feature to add to the module, I want to resist adding any new functionality to entity lookup.

  • 🇳🇱Netherlands idebr

    Rerolled against the latest 6.0.x

  • 🇩🇰Denmark ressa Copenhagen

    Thanks @idebr, this would be a nice feature to have in on of my favourite Migrate Plus plugins, entity_lookup :)

    I have added an example in the "Proposed resolution" section.

Production build 0.71.5 2024