Hello everyone,
I'm new to Drupal so please bear with me if I get anything wrong! :) I've just fixed a problem on a development version of a website that I am working on. I have been trying to get geocoding to work on UK addresses and it has been causing me great difficulties up to now. I have managed to fix the problem but am not sure if others may be experiencing it so I thought I should post details here so that other people can check it out and if so make a patch (I'd do this myself but I'm not really sure how to nor if the problem is just on my copy or what). Here are the details that I posted in another thread (http://drupal.org/node/158101#comment-725586):
------------
Anyway, what I found - after hours of tracing through code - was that the "location_geocode_uk_google()" function in location.uk.inc was not getting called. I tracked it down to line 1032 of location.inc:
if (function_exists($exact_latlon_function)) {
The problem is that the function does not seem to exist. The reason being that the provider is google|uk. Now I don't know whether this is just my installation or everyone elses so I will report a bug for others to check it out. However, if this is a problem for others I will also post how I resolved it...
On line 1026:
$exact_latlon_function = 'location_geocode_'. $country .'_'. $service;
I added in some code to remove the pipe and UK ("|uk"):
$exact_latlon_function = 'location_geocode_'. $country .'_'. substr($service, 0, strpos($service, '|'));
This then allowed the code to work correctly.
------------
I'd appreciate it if others could check this out and let me know if they are also experiencing it, and if so then point me in the right direction to providing a patch.
Thanks!
Steve
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | location_service_pipe_fix.patch | 796 bytes | stephenpickett |
Comments
Comment #1
stephenpickett commentedHello,
I've read up a little bit on how patching works and how to create a patch and the result is attached. Someone please test and let me know if it works for you or not and then we can go from there.
Thanks for the help! :)
Steve
Comment #2
bdragon commentedCommitted to HEAD, thanks!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.