Support array key '0'

Created on 24 July 2023, over 1 year ago
Updated 18 September 2023, over 1 year ago

Hi and thanks for this module!

The module does not seem to support arrays with a key set to 0.

For instance if a migration looks like this:

myfield:
    plugin: make_array_associative
    key: 0
    source: language

Then it fails with this error:

$ drush migrate:import mymigration
In MakeArrayAssociative.php line 75:
                                                                   
  The make_array_associative plugin must define the key property.  

Any chance we can support array keys set to 0 (but still reject invalid keys such as FALSE or NULL ? Attached is a proposed patch.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada fengtan Montreal, Canada

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

Comments & Activities

Production build 0.71.5 2024