Drupal 8 Migrate Process Plugin: migration_lookup_target_ids

I was having some difficulties using the migration_lookup process plugin. I wrote this plugin so that I could make sense of how the migration lookup was working and the data that it was returning. The plugin ended up being something that I use after every migration_lookup as it seems to ensure error-free lookups. YMMV.

UPDATE: After moving from Drupal 8.5 to 8.7.3 I had to make some changes to this.

There is almost certainly an out-of-the-box way of writing migration YML so that this plugin is not needed. For now, my 2-year old D8 site will live on with this plugin.

Drupal 8.7.3


Drupal 8.5:


One Comment

  • mstrelan

    Thanks for this plugin. I found when creating stub paragraphs migration_lookup will return a keyed array of “id” and “revision_id”. I modified this plugin to convert these keys to “target_id” and “target_revision_id” if they were found. See issue 2890690 for reference.

Leave a Reply

Your email address will not be published. Required fields are marked *