Closed (fixed)
Project:
Location
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Mar 2011 at 17:57 UTC
Updated:
8 Apr 2013 at 11:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
finmccarthy commentedWill
I think this is the same issue I had, if so the resolution is to rename the file located at
"sites/all/modules/location/supported/location.uk.inc"
to
"sites/all/modules/location/supported/location.gb.inc"
Turns out that the iso code for the UK is GB. I had to clear cache / reload pages etc afterwards
Finbarr
Comment #2
willhallonlineIt appears that this goes half way and then you have to rename all of the functions to 'gb' from 'uk' inside the newly created location.gb.inc file to get map links to work. I am sure I have seen something like this before, not sure where though.
Not sure how to commit changes to files as it appears this will keep happening until it does?
Thanks
Comment #3
jeremypinto commentedHi,
I have the same problem and tried to rename the file and functions, but it doesn't work. Did I miss something?
Comment #4
idimmu commentedAfter you've done this, don't forget to go to :
You are here
Home » Administration » Configuration » Content authoring » Location
Go to Location Utilities then 'Clear Supported Country List'
After that go to 'Geocoding Options' and enable 'United Kingdom'
bamo!
Comment #5
idimmu commentedattached my working location.gb.inc file, please rename the attachment to location.gb.inc as drupal has renamed it for security
Comment #6
finmccarthy commentedThanks idimmu & willhallonline
I have used the file above and it works a treat.
Finbarr
Comment #7
simg commentedI found that whilst the attached location.gb.inc allowed me to enable to UK geocoding, it didn't then actually do the geocoding :/
I then found this post http://drupal.org/node/1051728 which refers to a patch to location.uk.inc which I think has somehow crossed with the above. So, I've applied the patch (had to be done by hand) to location.uk.inc and then changed the function names to _gb as above.
So, patched and "gb'd" code is attached. Exact geocoding now seems to be working for me in the UK :)
Comment #8
rooby commentedAlso see #832864: Invalid iso codes for countries. UK should be GB, which is an issue for fixing the uk/gb issue for all versions.
Comment #9
rooby commentedMarked #832864: Invalid iso codes for countries. UK should be GB as duplicate because you have already done work on this here.
In addition to the modified location.gb.inc we need to do database updates for the location table and the zipcodes tables.
The zipcodes.uk.mysql file also needs updating.
Comment #10
Anonymous (not verified) commentedJust dropping my patch in here which I posted first elsewhere but have just been alerted to this issue... thought it might be of help
http://drupal.org/node/1068724#comment-4270770
Comment #11
pjcdawkins commentedSubscribing
Comment #12
pjcdawkins commented@stevepurkiss #10
After attempting to apply that, it turns out the file location.uk.inc remained (alongside a location.uk.rej). On deleting location.uk.inc and clearing the Location caches, it started working (United Kingdom was then available as a choice).
Comment #13
sammyd56 commentedsubscribe
Comment #14
Anonymous (not verified) commentedRe-rolled following the Git instructions and against 7.x-4.x-dev as that's now out should work ok.
Comment #15
Anonymous (not verified) commentedMy bad - seems I should've rolled it against 7.x-3.x branch. Revised patch attached for review.
Comment #16
malcomio commentedthe patch in #15 works for me
Comment #17
hutch commentedthe patch in #15 works for me, on the current 7.x-3.x-dev
Updating zipcodes and location table as per #9 finished the job off, all is working again for gb/uk
I would regard this patch as RTBC
Comment #18
jamsilver commentedThe patch also needs to change the database/zipcodes.uk.mysql to database/zipcodes.gb.mysql, replacing all occurances of 'uk' with 'gb'.
With this patch - when installing the module from scratch, there is no need to run the mysql update commands in #9. If updating an existing location installation, then those commands will still need to be run.
Comment #19
deeve commented..without wishing to appear too dim, if I'm using cygwin to apply patch #15 & I've already cd'd to my 'location' files folder, should the cygwin command line to execute then be:
c:\cygwin\bin\patch.exe -p0 < e:\Drupal-7.0\sites\all\modules\dev\location\uk2gb-1083128-15.patch
only asking as nothing seems to be happening?
Comment #20
hutch commentedI have no experience of cygwin but it is well spoken of so it should work.
It is a git patch so use -p1
If the patch is in the current folder then you probably do not need the full path.
c:\cygwin\bin\patch.exe -p1 < uk2gb-1083128-15.patch
Comment #21
ankur commentedI'd like to commit the patch given in #18, but it doesn't apply cleanly. It also needs to add a schema update function to location.install.
Anyone want to roll a git patch with it and post back?
Comment #22
hutch commentedHere is a freshly rolled patch, tested on a new git clone of location-7.x-3.x. It does not include any changes to location.install as it is not clear to me what those changes might be.
apply with
patch -p1 < location-uk2gb-1083128-22.patch
Comment #23
ecoluke commentedPatch #22 works for me - although I tore my hair out for a while until I noticed post #4! Ooops.
Comment #24
Luttappi commentedHi,
After applying patch from post 22, I can now get the State/Provice drop down populated with values and removed an error from the proximity search form. But, I can't get the proximity search working. Other than applying the patch, I have updated the country column in zipcodes table with 'gb'. Is there anything I am missing? The location version I am using is 7.x-4.x-dev. I can see the database table still don't have values for "city" and "state" columns? Is system expecting values for these?
I am relatively new to Drupal. Any help would be appreciated.
Thanks,
Comment #25
ankur commented@Luttappi in #24:
While this is a bug that needs to be fixed in both 7.x-3.x and 7.x-4.x, you should not be using 7.x-4.x but should be using 7.x-3.x. It's not ready for production and I wouldn't even really say it's ready for testing. Please see the module home page for details: http://drupal.org/project/location
Comment #26
sammyd56 commentedWhat is stopping this being commited?
Comment #27
ewills commentedI can confirm this works on 7.x-3.x-dev
Comment #28
Luttappi commentedThe reason I used 7.x-4.x was, I saw a post somewhere saying 7.x-3.x won't work with 7.8, unless I use a patch. Since I don't have SSH/Telnet access to my server (It is a shared server), I don't know whether I can apply the patch, unless someone can shed some light on it (Please note, I just started with Drupal last week). But, I will download 3.x and see whether it makes any difference.
But, as I said, I am almost there. The Map seems working, but I can't get the distance from post code in the result set. Here is the example http://www.halalfinder.co.uk/locator (May use post code E1 7JF for testing)
Many Thanks,
Comment #29
ankur commented@Luttappi iun #28
If you can find where it says that location needs to be patched to work with 7.8, please post a link to that place here and I'll take a look when I get a chance.
@sammyd56 in #26
We still need to add an update function that changes the country code in the zipcodes table, the location table, and any settings in the variable table where 'uk' is also being used. If anyone else can think of any other place in the database where we would need to change 'uk' to 'gb', please add it to this list:
zipcodes table
location table
variable values
Comment #30
hutch commentedSomething like this:
Comment #31
ankur commentedI took hutch's patch from #22, added hutch's update function from #30, and added the following line to the bottom of that update function from #30:
I went ahead and committed it to the 7.x-3.x and 7.x-4.x branches.
If something was missing, we can always add another update function.
Thanks to everyone for the patch revisions.
Comment #32
eamontaylor commentedJust adding that I did everything in step #1 and #2 but nothing happened until i edited
"sites/all/modules/location/location.inc"
and changed
'uk' => t('United Kingdom'),
to
'gb' => t('United Kingdom'),
hope this helps.