Hi guys,
It seems the admin/config/content/location/geocoding URL is not working anymore.
When I try to access the page I got an error in function function google_geocode_country_list_xml() {}
Error happens only if you don't have previously cached values for the country list.
As i found out the issue is with the http://spreadsheets.google.com/feeds/list/p9pdwsai2hDMsLkXsoM05KQ/defaul... URL which is not accessible for me.
Does this spreadsheet has some country based restriction or something? If yes, it doesn't work from UK.
The error in php returned is:
Fatal error: Call to a member function asXML() on a non-object in /Library/WebServer/Documents/WORKSPACE/opencommerce/sites/all/modules/contrib/location/geocoding/google.inc on line 38
Error when I debug the http_request call:
stdClass Object
(
[data] => You do not have view access to the spreadsheet. Make sure that you are properly authenticated.
[errno] => 0
[redirect_url] => http://spreadsheets.google.com/feeds/list/p9pdwsai2hDMsLkXsoM05KQ/defaul...
[request] => GET /feeds/list/p9pdwsai2hDMsLkXsoM05KQ/default/public/values HTTP/1.1
User-Agent: Drupal (+http://drupal.org/)
Accept: */*
Host: spreadsheets.google.com
[protocol] => HTTP/1.1
[status_message] => Forbidden
[headers] => Array
(
[content-type] => text/html; charset=UTF-8
[set-cookie] => NID=67=XjgNL60BY3V5lQY1Vh_N60qyuQrur8rb5moyU4qLXqe6D8Q1ZzDvd_8hP_t9yUsNsYwIIlJZlqBQe3YDwSVyjBdXP2b0lE0xfy5XWADw_FHlxLIyhMTYsSqdgWTBV9bX;Domain=.google.com;Path=/;Expires=Wed, 15-Jul-2015 12:14:10 GMT;HttpOnly
[p3p] => CP="This is not a P3P policy!
| Comment | File | Size | Author |
|---|---|---|---|
| #48 | location-google_geocoding-2406483-48-d6.patch | 3.92 KB | jojonaloha |
| #12 | google_geocoding-2406483-12.patch | 3.87 KB | egfrith |
Comments
Comment #1
randomyao22 commentedI met this exactly same error today too. It works two days ago. I'm in Australia.
As greg_meszaros said above, need some one have a look at why this google feed not available any more, which is in geocoding/google.inc.
http://spreadsheets.google.com/feeds/list/p9pdwsai2hDMsLkXsoM05KQ/defaul...
Comment #2
pog21 commentedSame problem here. Trying to access the google spreadsheet results in 403 forbidden.
Comment #3
randomyao22 commentedI think my local site has a cache so it is still working. Is there a way to find the local cached country list data and copy them to my server site? I tried cache_get('location_google'), but I can get nothing.
Comment #4
randomyao22 commentedBefore someone can fix it, I find a way to temporary make my site work.
I tried to find the location geocode data in my local site database(Which is installed before bug happened) and find these useful for me. Added following data to my new site's database, make it works now. This is just temporary solution, make my store locator work. Still waiting for module developer to fix this bug.
Comment #5
falc0 commentedanother temp solution: http://web.archive.org/web/20120626231608/http://spreadsheets.google.com...
Comment #6
boomman14 commented#5 works for temp fix. Thanks falc0.
Comment #7
dkane commentedFalc0: I swapped out the url in $source = drupal_http_request in google.inc to the one above and now Google maps is showing up in my geocoder list, but it still doesn't seem to be geocoding new locations. Did I miss a step?
Comment #8
joegl commentedHaving the same issue. Getting a Fatal Error when trying to access the Geocoding Settings page. Co-worker says it was working fine a few days ago.
Comment #9
dkane commentedJoegl. I was getting the fatal error as well. https://www.drupal.org/node/1070644#comment-8007895 helped me solve that.
Now I'm able to access and save settings, but new locations are still not geocoding.
Comment #10
joegl commentedI was able to access the page by updating the spreadsheet URL to the web.archive.org link in comment #5 (thanks falc0). This got rid of the fatal error. I was also able to finally generate lat/lon for my content types, but I'm having an issue with using the full province/state name versus the abbreviation. I will be opening a new issue for that.
Comment #11
hyperlinkedThe web.archive.org link will fix the WSOD issue. Now here's a workaround you can use to grab the geocode coordinates in a hook_node_presave function. Just drop this into a custom module. You can just do your own lookup to get the geocoordinates.
You can also adapt this to work as part of a locationapi save action or a hook_user_presave if you need to do the geocoding directly on a location because you're not always handling locations as part of a node save.
Comment #12
egfrith commentedAt #1269914-23: Geocoding no longer working (google.inc) hutch comments:
The attached patch removes google_gecode_country_list_xml() and gets google_ google_geocode_country_list() to return the keys of location_get_iso3166_list().
Comment #13
egfrith commentedComment #14
pog21 commented#12 worked for me. Thanks for patch.
Comment #15
philypatch #12 worked for me, thanks
Comment #16
liezie_d commentedapplying this patch gives me a new error :
Notice: Undefined variable: countries in google_geocode_country_list()
(regel 17 van C:\\sites\all\modules\location\geocoding\google.inc).
UPDATE: nevermind.. i manually patched and missed a line..
Comment #17
egfrith commentedHmm... Just to check the patch has worked as intendended, does google_geocode_country_list() in C:\sites\all\modules\location\geocoding\google.inc look like this:
?
Comment #18
liezie_d commented@egfrith: it's fixed. i had accidentaly also removed the line that starts with "$countries ... "
Comment #19
joegl commentedI am on 3.x.2 so the patch does not work for me. However, for people in a similar boat all you need to do is replace the google_geocode_country_list() function in google.inc with this code:
Comment #20
anacat commentedI used the patch, I don't have any errors.
But I still don't get the options or configure part, most of them say "none supported" and "No service selected for country."
What am I missing ?
Comment #21
joegl commentedI am not sure #20 since I setup mine following instructions from another site.
Do you have the gmap and gmap_location modules? Not sure if they're necessary but might be.
You also might want to go to this page: admin/config/content/location/util and clear both of the cache's.
Comment #22
anacat commentedHi Joegl,
Thanks for the repply :)
Yes I have both modules enabled and I followed your suggestions but nothing changed :/
I dont know if it helps but I only find options from Canada, new zealand, united states. And the options are: "none", "Yahoo! Maps Web Services (Terms of Use)"
and no google maps button option like it was before this bug.
Comment #23
joegl commentedDo you have an Google maps API Key? I don't think it's necessary but might help.
Also, on the Main Settings page for the Location module do you have the "use a google map to set latitude and longitude" checkbox checked?
Wish I could help more. It sounds like that even though you have the patch it still isn't loading the countries properly but I could be wrong.
Comment #24
anacat commentedSo I did the things you suggested (actually they were missing, thanks! :) ) but still no changes.
I get the page geocoding options working (it takes a bit to long to load) but then almost all countries say something like:
Example.: Afghanistan None supported. No service selected for country.
Comment #25
anacat commentedNevermind ! I did it all over again following all steps and now its working.
Thanks everybody for the great comments/problem solving discussion & solutions. :)
Comment #26
pjnes commentedThe patch in #12 works for me as well.
Can we get this rolled in to a new release?
Comment #27
drummondf commented#12 worked for me, thank you.
Should this be commited or does it have "side effects?"
Comment #28
joegl commentedPatch is no worse than the current Fatal Error being served and preventing the page from loading. As far as I know no funny business.
Comment #29
drummondf commentedOne thing I noticed (and it may be from somewhere else in my config) but Google Maps is no longer an option for geocoding? Only Yahoo Maps. Does anyone else have this side effect?
Comment #30
egfrith commented@drummondf On admin/config/content/location/geocoding I have a long list of countries. For every country Google Maps is an option. For New Zealand, Australia and the USA, Yahoo is also an option. Is the behaviour you see different from this?
Comment #31
drummondf commented@egfrith yes, I get "none supported" for nearly everything except Australia (Yahoo Maps), Canada (GeoCode.ca) and US (Yahoo Maps)
The only thing non-standard with my install is the patch in #12 above.
I have toggled the "Use a Google Map to set latitude and longitude" at /admin/config/content/location and both settings returned the above results.
Comment #32
netgeek123 commentedran patch and it fails...
reject file...
Comment #34
egfrith commented@drummondf: Is the gmap module enabled on your site? The docs suggest it is needed for geocoding:
https://www.drupal.org/documentation/modules/location
Comment #35
netgeek123 commentedDOH!
Comment #36
drummondf commented@egfrith it is installed, enabled, configured properly and displaying maps in other forms
Comment #37
flyke commentedPatch #12 works for me
Comment #38
podarok#12 commited
Thanks!
Comment #40
RonP commentedI am trying to build a site and am running into this error. Is it fixed in the released build ? I have no idea how to patch a module.
Thank you
Comment #41
pog21 commented@RonP There is information on patching here: https://www.drupal.org/patch/apply. This would be appied against 7.x-3.6.
But by the looks of things, you can update to the latest dev (7.x-3.x-dev) which now has the patch applied (see #38, #39, above).
Comment #42
Szerge commented@pog21: updated to 7.x-3.x-dev and I now have a blank page at admin/config/content/location/geocoding. Eearlier #12 fixed the blank page but not the geocoding. I created a module with #11 but I must have missed a step as there was still no geocoding...
Comment #43
pog21 commented@Szerge, I am still using the patched 7.x-3.6 and it seems fine. So other than rolling back (completely - i.e. uninstalling/deleting directory/flushing caches like crazy) and patching (correctly, via command line), I don't really know what to suggest.
Comment #44
Szerge commented@pog21, thank you. I've now installed Location 7.x-3.7-beta1 and admin/config/content/location/geocoding displays the list of countries and I can select Google to perform the geocoding for the different countries. The only thing is that no geocoding seems to be performed... Although not mandatory, I've a valid key, to no effect. So, no more white page but no geocoding....
I remember clearly with a working version (months ago!) that when I selected the country, one second later the lat/lon fields were automatically filled-in. Not anymore :-(
Comment #45
joegl commentedDid you clear cache? Do you have the gmap and gmap_location modules installed? Did you disable and re-enable the module after patching? I don't think the WSOD has been reported for this issue yet.
Comment #46
joegl commentedDid you clear cache? Do you have the gmap and gmap_location modules installed? Did you disable and re-enable the module after patching? I don't think the WSOD has been reported for this issue yet.
Comment #47
robdubparker commentedAny chance if this patch being committed to Drupal 6.x version?
Comment #48
jojonaloha commentedAttached is a re-roll of the patch from #12, committed in #39 for the 6.x-3.x branch.
Comment #49
pog21 commented#48 worked for me. Thanks for the patch.
Comment #50
caspervoogt commentedI'm on D7 and #12 works for me.
Comment #53
jeffschuler@plethoradesign: #12 was already committed to the D7 version (see comment #38).
Just download the 7.x-3.x-dev version of the module.
Comment #54
caspervoogt commentedthanks Jeff. Not sure what I did. Maybe I had applied it to 7.x-3.6 or something.
Comment #56
podarok##4 commited
Thanks
Comment #60
jeroentComment #61
tinem commentedSo all here in this discussion are using 6.x-3.x-dev and have no problems? If this is the case shouldn't this version be recommended instead of 6.x-3.4?
Not sure you have seen my post https://www.drupal.org/node/2540086 asking for help, please?