14.10.2026 | Nikolas Kopp

Skip migrating row if the value is an empty array

skip_on_empty_array.yml
  skip_on_empty_array:
  -
    plugin: single_value
    source: file_path
  -
    plugin: skip_on_empty
    method: row

Issue:

The single_value plugin is necessary since the skip_on_empty plugin doesn't work with an empty array properly. See Issue: https://www.drupal.org/project/drupal/issues/3239410 

Prerequisites:

The migrate_plus module needs to be enabled.

Solution:

The provided snippet skips the row if the value is an empty array.