Add Empty coalesce process plugin as an alternative to NULL Coalesce.

Created on 20 January 2022, over 3 years ago
Updated 8 July 2025, 3 months ago

Problem/Motivation

NullCoalesce wasn't working on the migration of field_image/0/alt value, until I further realised it was giving an empty string in its' value from db table.

Provide Empty string value coalesce processing as an alternative compared to NullCoalesce.

Even though we could create a NULL value by additional processing of empty string validation, it would be an extra hassle for general migrations. Especially to people who has no visual of the migration values.

Example:

Value shows empty string imported

process:
  title:
    -
      plugin: get
      source: title
  field_image/0/alt:
    -
      plugin: null_coalesce
      source:
        - field_image/0/alt
        - title

The field_image/0/alt shows an empty string instead of NULL value, therefore not returning source title

Steps to reproduce

Proposed resolution

Add a new process plugin that is similar to NullCoalesce, but returns "empty string" in the end when all source value loops through !empty.

foreach ($value as $val) {
      if (!empty($val)) {
        return $val;
      }
}
return "";

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: won't fix

Version

5.0

Component

Plugins

Created by

🇹🇼Taiwan g-brodiei

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.71.5 2024