Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I upgraded to the latest dev release but now when I save a node to geocode it I get the following error:
I'm using the Google maps API with a free key.
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'geocoder_google_field' not found or invalid function name in geocoder_widget_get_field_value() (line 297 of /code/sites/all/modules/contrib/geocoder/geocoder.widget.inc).
I will try to figure this out later but I'm noting this now in case anyone else runs into the same issue.
Comment | File | Size | Author |
---|---|---|---|
#13 | geocoder-2647536-13.patch | 1.43 KB | rudiedirkx |
Comments
Comment #2
jasom CreditAttribution: jasom commentedI confirm that after dev update Google geocoder doesn't work.
URL with error: admin/structure/types/manage/contenttypename/fields/field_geofield_ad
I use Geolocation module to get lat and long from geocoder field in field field_geofield_ad.
Also important to mention: I have multilingual site. On english version (main language) is everything OK. When I switch to Czech or German version Geocoder doesn't work.
Here is the latest working dev release from November 20, 2015 10:14.
Comment #3
erwangel CreditAttribution: erwangel commentedSame here with 7.x-1.2+35-dev (2016-jan-07)
Warning : call_user_func() expects parameter 1 to be a valid callback, function 'geocoder_google_field' not found or invalid function name dans geocoder_widget_get_field_value() (line 297 of /path-to/sites/all/modules/geocoder/geocoder.widget.inc).
Comment #4
jasom CreditAttribution: jasom commentedHere's the latest working DEV.
Comment #5
Simon Georges CreditAttribution: Simon Georges at Makina Corpus commented@Pol, since you've done the majority of the recent commits, does it remind you of something?
Comment #6
jasom CreditAttribution: jasom commented- Who broke the module? Who was that?!
- Pol! He did it!
:)
Comment #7
Plazik CreditAttribution: Plazik as a volunteer commented@jasom thanks for this version.
I've also had to run
drush rr
to make it works.Because this breaks module functionality I've marked it as "Critical".
Comment #8
PolHi all,
First, this is the development channel of the module, so, you might expect things to break.
Second, I'm very sorry for this, I will fix what I broke for sure.
Third, the function is still in the module, I need to figure out why it's not more available.
I'll fix this for today I think.
Comment #9
rudiedirkx CreditAttribution: rudiedirkx commentedAdding
before line 145 fixes it for me, but it seems very unlikely someone removed something like that... The fix does make sense though, because the handler has to include itself, kinda.
Patch attached for just that.
Comment #10
rudiedirkx CreditAttribution: rudiedirkx commentedIt looks like 44c79b5 broke it, which makes sense, because caching it, means the file isn't included anymore. I think #9 fixes it decently, but there might be a ctools include function to do that correctly.
Comment #11
rudiedirkx CreditAttribution: rudiedirkx commentedActually, that should be a
require_once
instead of aninclude
.Comment #12
PolShouldn't we use ctools_plugin_load_includes() ?
Comment #13
rudiedirkx CreditAttribution: rudiedirkx commentedNot good enough. Needs more inclusion, for all callbacks.
Now with handler include helper. Last time.
The ctools function looks... HUGE for just including 1 file. I don't know what ctools expects. Maybe there's more important logic in
ctools_plugin_load_includes()
, but it seems excessive.Comment #14
rudiedirkx CreditAttribution: rudiedirkx commentedAnd what is this?!?
Should that make the string
because it's missing a few quotes then. Or is it supposed to make
because that's concatting arrays into strings...
I don't trust ctools =) never have.
Comment #15
PolCTools is not perfect indeed... but it helped us a lot.
I think we should use api functions for now as much as possible, we'll have more options in Geocoder 2.x.
With ctools_plugin_load_includes(), does it works ?
Comment #16
rudiedirkx CreditAttribution: rudiedirkx commentedI haven't tried. I didn't know it existed until now. I might tomorrow.
Comment #17
PolOk, let me know if it works then, I'll commit it asap after that.
Comment #19
PolHi all, I've fixed it.
Sorry for that.
In the meantime, you can have a look at Geocoder 2.x @ http://github.com/drupol/geocoder
Comment #20
rudiedirkx CreditAttribution: rudiedirkx commentedI'm still getting this, when saving a new field (in POSTback). The URL is
/admin/config/people/accounts/fields/field_geostuffs?destinations[0]=admin/config/people/accounts/fields
and I just confirm-saved the new field. When I go back one page, it's still broken.In
geocoder_get_handler()
is apparently not enough.Error:
Comment #21
MXTJust upgraded to latest 7.x-1.x-dev.
Google geocoding is not working now, simple address are not geocoded:
And I get this warning:
Comment #23
PolHi,
I've updated again, can you try and give me feedback please ?
Comment #24
rudiedirkx CreditAttribution: rudiedirkx commentedNope. Still fails on the widget form. It's not that hard =) Line 146.
$settings_callback
is a function. It doesn't exist. #13 does that. I'm not sure if #22 did anything, I don't know howgeocoder()
would be called.Comment #25
PolOh I didn't see that patch!
Can you please reroll it and remove the useless require_once ?
Thanks !
Comment #26
rudiedirkx CreditAttribution: rudiedirkx commentedNo, you're almost there! =) Just add the handler function on 1 more location (psst line 146) and we're done, I think. #22 was useful. There are 3 locations (so far) that require the explicit handler include/load, not just 2 like I thought.
Comment #27
PolVoila, done.
Sorry, for the bug :(
Comment #29
rudiedirkx CreditAttribution: rudiedirkx commentedNope.
and then a
Go home Pol, you're drunk =)
Comment #30
PolShit... I think I've fixed it.
Comment #32
rudiedirkx CreditAttribution: rudiedirkx commentedYes, I think that was it! I'm proud of you man. Time for weekend.
Comment #33
PolGeez, I really needed some sleep :-)