The Openlayers Geofield sub-module uses the function openlayers_widget_geocode() as an AJAX callback for geocoding.

This function is in the Geofield module, specifically in the file geofield.widgets.openlayers.inc, along with the other old Geofield Openlayers widget code.

The recommended geofield widget code is now stored in the Openlayers Geofield module, not in Geofield itself. However, this one callback is still used from the old widget.

I propose that we move (copy and rename) this function to the Openlayers Geofield module.

Patch to come...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Status: Active » Needs review
FileSize
1.82 KB

Status: Needs review » Needs work

The last submitted patch, 2: openlayers_widget_geocode_callback-2762367-1.patch, failed testing.

m.stenta’s picture

Status: Needs work » Needs review

(Maybe we should disable automated testing on this module? I don't think it's working as intended.)

m.stenta’s picture

(Created a new issue for the testing issue: #2762377: Automated testing is broken)

m.stenta’s picture

Further debugging in #2755899: Geocode button doesn't work has proven that this function can be even simpler. Attached is a new patch that simply returns the geofield element, without making any changes to it within the function. Generally, Ajax callbacks should only return the element that they are replacing - and in most cases all action should be in the submit function. The logic for geocoding is already in openlayers_openlayers_use_geocoder_submit() so it does not need to be duplicated here.

Status: Needs review » Needs work

The last submitted patch, 6: openlayers_widget_geocode_callback-2762367-6.patch, failed testing.

m.stenta’s picture

Status: Needs work » Needs review

  • Pol committed b686da0 on 7.x-3.x authored by m.stenta
    Issue #2762367 by m.stenta: openlayers_widget_geocode() should be in...
Pol’s picture

Status: Needs review » Fixed

Thanks again :-)

Status: Fixed » Closed (fixed)

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