import_drupal icon indicating copy to clipboard operation
import_drupal copied to clipboard

How should I process empty fields ?

Open JanLaureys opened this issue 6 years ago • 1 comments

What is the easiest/cleanest way to process fields that are empty sometimes. For example I have a node type service with a field field_intro.

Most of the time this field is just an array ['value' => '<p>Intro</p>', 'format' =>'filtered_html'].

I use the extract plugin to get the value and format as shown in the examples, but when the intro is not filled in jsonapi module returns field_intro: null and the extract plugin fails.

I've tried a lot of stuff with default_value plugin and array_reset stuff but I can't seem to get it working.

I would also be nice to have an example in this module on how to handle that situation.

JanLaureys avatar Mar 14 '18 16:03 JanLaureys