StaticMap documents that NULL is a supported map value but causes an error

Created on 4 July 2024, 2 months ago

Problem/Motivation

In the StaticMap process plugin, it's documented that mapping NULL is supported: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/migra...

 * A NULL can be mapped. If the value of the source property 'foo' is NULL then
 * the value of the destination property bar will be 'to'.
 *
 * @code
 * process:
 *   bar:
 *     plugin: static_map
 *     source: foo
 *     map:
 *       NULL: to
 * @endcode

Doing this causes a YAML parse error

Non-string keys are not supported. Quote your evaluable mapping keys instead at line 57 (near "NULL: 0").

If you quote the NULL string then you don't get the parse error, but that then maps the literal string "NULL" not the NULL value so it doesn't have the desired effect.

Mapping NULL is required (in my case) to map a value when a field is empty.

Steps to reproduce

Either remove documentation for the support, or come up with a solution

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¦πŸ‡ΊAustralia acbramley

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

Comments & Activities

Production build 0.71.5 2024