Every time I go to view an entity with a leaflet field formatter on a geofield, I get this:

Fatal error: Call to undefined function geofield_load_geophp() in /var/www/ftcforreal/sites/all/modules/contrib/leaflet/leaflet.formatters.inc on line 212

I have geophp, the latest geofield, and the dev version of leaflet (tried it with alpha1 as well with the same error).

I will report back on what happens when I backport geofield!

Comments

rerooting’s picture

Huh, kind of works if I change the functioned called in leaflet.formatters.inc from geofield_load_geophp() to load_geophp(), as this is the function called by geofield. Now I don't get the error, I just get the grey container issue, which I will now check out!

rerooting’s picture

Oops! Didn't have a map selected.

It looks like changing the function as I mentioned in #1 works fine. Might want to debug this further, but it seems like a patch for this is almost unneeded given how simple it is! I can submit one anyways.

rerooting’s picture

Status: Active » Needs review
StatusFileSize
new455 bytes

Ok I was going to change the status anyways, so might as well upload a patch.

Lev - let me know if you need any further help debugging this, but this minor fix *seems* to work for someone (me) who just started using leaflet today!

rerooting’s picture

StatusFileSize
new455 bytes

Crap! Only I would screw up a patch that simple. geophp_load not load_geophp... yeah.. haha

rerooting’s picture

This appears to be the commit to blame:

http://drupalcode.org/project/geofield.git/commitdiff/69189a6d128affd8bd...

Looks like this has to do with them implementing the new geophp module - thus the hook_load() on a the geophp module rather than geofield!

pvhee’s picture

StatusFileSize
new455 bytes

Attached a patch to replace "geofield_load_geophp" with "geophp_load", which fixes the problem.

rerooting’s picture

haha! you must not have read #4, does the exact same thing ;)

pvhee’s picture

Sorry rerooting, must have missed that :) Good we're on the same line I guess!

rerooting’s picture

Its no problem! I should have been more explicit about what I was doing. Your comment alongside your patch was much more useful than my plodding about several times over! After 4 years, I'm still learning how to properly patch and use the issue queues :)

But yes, this patch was super crucial for us. We just launched our new site using a bean with a geocoded geofield from an addressfield with a leaflet formatter and a custom map. I LOVE the leaflet module. As soon as this fix is committed to the leaflet module I am going to release a feature that demonstrates how to do just that with bean, geofield, geocoder, etc. and it will include an example custom map.

pvhee’s picture

Status: Needs review » Fixed

#4 has been committed. Thanks rerooting!

rerooting’s picture

Thanks to you as as well pvhee! I'll be sure to test the hell out of the views submodule. So excited about leaflet!

Status: Fixed » Closed (fixed)

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