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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

khaled.zaidan created an issue. See original summary.

khaled.zaidan’s picture

khaled.zaidan’s picture

Status: Active » Needs review
itamair’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
522 bytes

Thanks for reporting this @khaled.zaidan
BUT in Geofield the (0.0) coordinate is not supported, and won't be stored in the Geofield storage.
Patch adjusted to weather allow coordinates with either lat or non not 0.
Committing attached patch into dev, will be part of the next Geofield module release.

  • itamair committed 82569fb3 on 8.x-1.x
    Issue #3403837 by khaled.zaidan, itamair: Geofield fails to migrate...
itamair’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.