Problem/Motivation

If the map geocoder settings options are '' (default not set) the request from the geocode map 'field' to geocode is encoded as:-

http://example.com/geocoder/api/geocode?address=What%20has%20%been%20typ...

The null is being treated as the string 'null' by geocoder Drupal\geocoder\Controller\GeocoderApiEnpoints::setGeocodersOptions() which is then passed into NestedArray::mergeDeep causing it to throw an exception as it's getting the string 'null' as one of the arrays to iterate over.

Steps to reproduce

Create a geocoder configuration with the default options ''. Configure geofield to use geomap with the geocoder. With exceptions switched to be outputted the exception will be at the top of the json response from the geocoder.

Proposed resolution

Maybe not the best place, but I just in the GeocoderService::getJsGeocoderSettings switched to the empty string '' if Json::decode($map_geocoder_settings['options']) returned null.

Remaining tasks

Post patch, review.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ekes created an issue. See original summary.

ekes’s picture

OK. No patch. A fork. Good time to get used to the fork - branching that d.o is now offering :-)

ekes’s picture

Status: Active » Needs review

  • itamair committed 265e7b7 on 8.x-2.x
    Issue #3182632 by ekes: Geocoder requests includes the parameter options...
itamair’s picture

Status: Needs review » Fixed

@thanks! Committed into dev, will be part of the next release ...

  • itamair committed c805b5a on 8.x-2.x
    Empty Commit for Commit credit of Issue #3182632 by ekes, itamair:...

  • itamair committed 3e20fc3 on 8.x-2.x authored by ekes
    Empty Commit for Commit credit of Issue #3182632 by ekes, itamair:...

Status: Fixed » Closed (fixed)

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