Just thought i'd post this here in case anyone else had the same problem as me just now.

The geofield module which used to require the geophp module has now switched to using composer to manage the dependency.

Since the geophp module is no longer required as of that change, the call to

geophp_load();

fails in

function leaflet_process_geofield($items = array()) {
}

Composer autoloads the classes of any dependencies so we don't actually need the call to

geophp_load();

anymore.

Obviously if you aren't yet on the latest version of geofield which has made this change, then you won't need this patch and it will most likely cause your maps to stop working.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rossb89 created an issue. See original summary.

rossb89’s picture

Patch attached

rossb89’s picture

Status: Active » Needs review
rossb89’s picture

Assigned: rossb89 » Unassigned
szeidler’s picture

I can confirm, that the code-change is working, when using the recent version of the geofield module.

szeidler’s picture

Moving the priority to Critical, because when setting up a new project with geofield and leaflet now, leaflet module will call for an undefined method as long as the geophp module isn't enabled.

szeidler’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community
ippy’s picture

Yep. I encountered the 500/WSOD using Leaflet 8.x-1.0-alpha1 and Geofield 8.x-1.0-alpha2 (with phayes/geophp via Composer Manager) and can confirm that the patch worked for me. Many thanks :)

Patrick Ryan’s picture

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

We should probably keep this in to prevent breaking sites that haven't updated geofield. Checking to see if geophp is enabled should take care of both situations.

itamair’s picture

@patrick-ryan I don't think your addition is needed, and the patch is ok as it already was.
The Leaflet module haven't got any dependency from geophp and neither form geofield.
The leaflet_process_geofield function will be called just for a geofield field (it means if the geofield is installed ... ),
and the geofield module will (have to) include itself the geophp library ...
So it seems (imho) that the geophp_load() call became mostly/totally useless.

proweb.ua’s picture

#9 works

-enzo-’s picture

Using the Drupal Console project http://drupalconsole.com. You can install the module using composer in background.

Check the command

drupal module:download geofield --composer

acbramley’s picture

Status: Needs review » Reviewed & tested by the community

#2 should be committed, I agree with the comments in #10

tobiasb’s picture

Grimreaper’s picture

+1 for patch in #2

Thanks

  • pvhee committed d13f998 on 8.x-1.x authored by rossb89
    Issue #2731917 by rossb89: New version of geofield uses composer for the...
pvhee’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch, I agree with the comments in #10 and committed #1

Status: Fixed » Closed (fixed)

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