MigrationLookup's skipOnEmpty() means you can't provide a default value if a lookup fails

Created on 1 June 2018, about 6 years ago
Updated 8 March 2024, 4 months ago

MigrationLookup::transform() calls a helper method, skipOnEmpty(), and that throws a MigrateSkipProcessException if the source value for the lookup is empty.

But that means that a process pipeline can't specify a default value if a source row .

eg:

process:
  uid:
    -
      plugin: migration_lookup
      migration: users
      source: author
    - 
      # we never get here is 'author' is empty
      plugin: default_value
      default_value: 1

In particular, this means that a stub row created for an outer migration's lookup will always skip processing here, because the stub row creation won't provide a source value for the inner lookup.

✨ Feature request
Status

Closed: won't fix

Version

11.0 🔥

Component
Migration  →

Last updated 39 minutes ago

Created by

🇬🇧United Kingdom joachim

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.

Production build 0.69.0 2024