Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291609

skip_on_empty doesn't work if the value is an empty array

$
0
0

Problem/Motivation

Using the content_entity migration source, which takes entities from the local Drupal site, this configuration for a process mapping will never skip an empty field value:

  dummy_skip:
    plugin: skip_on_empty
    method: row
    source: my_field

This is because the field value when the field has no data is an empty array. The implicit 'get' plugin loads this, and because it's an array, MigrateExecutable::processRow() sets $multiple to TRUE.

That means that when processRow() comes to the skip_on_empty plugin, it iterates over the array, to pass each value to the plugin.

There are no values in the array, hence the skip_on_empty plugin is never called.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 291609

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>