Add a new configuration in MappingForm to skip empty on field target

Created on 12 August 2025, about 2 months ago

Problem/Motivation

If a field is required, e.g. name of taxonomy, `FieldTargetBase::getEntityTarget` would trigger error if that field is empty. Normally it is expected but could be trouble for multilingual import:

Multilingual taxonomies can be imported by feeds in a single table file like:
name, name_fr, name_es ...
which is much cleaner than separating translations into individual files. However, if some terms do not need translation (so that they inherit from the default language), the error mentioned above prevents import proceeding.

Meanwhile, empty value cannot simply be skipped because there would be cases that it is intended to empty the value.

So this is a dilemma situation that probably an additional configuration "Skip empty) could be introduced.
(BTW, SkipOnEmpty plugin of feeds_tamper does not work for this, it'd discard the whole item).

Steps to reproduce

On a multilingual site, create a csv with columns:
name, name_fr
Leave name_r empty and import.

Proposed resolution

Introducing a new config form element in `MappingForm`, e.g. `skip_empty` and check it and the field value in FieldTargetBase or maybe processor. If field value is empty and skip_empty is on, skip this field.

User interface changes

A new checkbox in mapping form.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024