Geofield fails to migrate coordinates with a 0

Created on 23 November 2023, 12 months ago
Updated 26 November 2023, 12 months ago

Problem/Motivation

The GeofieldLatLon.php migrate process plugin fails to handle coordinates with zeros, e.g. (0,0) or (51, 0), and returns a NULL instead of the legit coordinates.

Steps to reproduce

Setup a migration with the following migration config (might need a few tweaks to get it working):

id: test
source:
  plugin: embedded_data
  data_rows:
    -
      id: 1
      lat: 0
      lon: 0
  ids:
    id:
      type: integer
process:
  body/value:
    plugin: geofield_latlon
    source:
      - lat
      - lon
destination:
  plugin: entity:node

Result is that the body will have nothing saved in it.

Proposed resolution

Check for. the 0 values before returning a NULL (see patch).

Remaining tasks

Review/test

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom khaled.zaidan

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

Comments & Activities

Production build 0.71.5 2024