I have a module which needs to generate a list of zipcodes within a specified distance of a user-entered zip code. Previously, I was able to use this code:

$ziparray = location_nearby_postalcodes_bylocation($location, $radius, 'mile');

It looks like that function has been removed in 5.x-3.x and I can find no suitable alternative. How am I supposed to get a list of nearby zipcodes now?

CommentFileSizeAuthor
#5 location_search.zip2.37 KBchristok

Comments

seanr’s picture

FWIW, this has completely broken the zipcode search functionality of the letters module: http://drupal.org/project/letters.

bdragon’s picture

Assigned: Unassigned » bdragon

Hmm, looks like I killed that back in revision 1.85, as it was using the broken search cache stuff that got ripped out.

The api itself wouldn't be too hard to reimplement, I suppose.

seanr’s picture

OK, well, how do I fix my module now? I need that functionality in some form or another.

christok’s picture

Subscribe

christok’s picture

StatusFileSize
new2.37 KB

I copied the relevant search functions from 5.x-2.x to a separate .inc (attached) and commented out the cache search functionality since that was throwing errors. This is an ugly hack but it works for version 6.

seanr’s picture

Version: 5.x-3.x-dev » 6.x-3.x-dev

That's basically what I ended up doing, though I added letters_ before location in all the function names to avoid conflicts with older versions of locations. You can see it in the 5.x branch of letters and later today in HEAD. We really need to get this functionality back into location core.

yesct’s picture

Status: Active » Postponed (maintainer needs more info)

Please do an update and see what the status is in the new official or dev release. Some major changes have occurred. If there is still a problem, please post a detailed summary and set the status back to active (or if you post a patch, to needs review). Thanks.

ankur’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (fixed)

Looks like this became a support request with a satisfactory reply in #5.