I'm trying to migrate Drupal 7 users to Drupal 8. In Drupal 7, there's an additional text field representing the user's group. In Drupal 8, it's a taxonomy vocabulary. So I'm using the following pipeline:
field_user_group:
-
plugin: skip_on_empty
method: process
source: field_directorate
-
plugin: extract
index:
- 0
- value
-
plugin: entity_generate
value_key: name
bundle_key: vid
bundle: groups
entity_type: taxonomy_term
ignore_case: true
field_directorate
is the source field in D7, and field_user_group
is the target in D8.
Records without that value set should be caught by the skip_on_empty
plugin, and left blank, but that plugin seems to be failing (letting the process continue to the next plugin in the pipeline) as I'm getting errors from the extract
plugin saying:
Array index missing, extraction failed.
According to the documentation,
The skip_on_empty process plugin checks to see if the current input value is empty (empty string, NULL, FALSE, 0, '0', or an empty array). If so, the further processing of the property or the entire row (depending on the chosen method) is skipped and will not be migrated.
How is the processing even getting to extract
if skip_on_empty
is supposed to skip values with an empty array?
It works fine for records with the value set.
skip_on_empty
doesn't work, but I was able to work around this by dropping that plugin entirely, and going directly to extract. You can specify adefault
parameter that gets used if there are missing keys. I set it to the empty string '', and then there were no more failures. – colan Mar 30 '18 at 17:03