Location module is not fulfilling some needs, so I've got into a point where there nothing else to do but start coding. The idea is to do the following patches as soons as I can, based on 6.x-3.1 version:
- one country only
I think a great part of Drupal sites are national wide (created for users of one country only); so there is a lot of code in Location module that can be jumped for that kind of site
- district/county/subregion field
some countries, like Brazil, have their cities divided into districts or counties or subregions; so location based sites can't help their users efficiently without this field
- auto-complete re-use of locations
in many sites (like the event/venue model) repeated locations are the most common; so it will be much easier and space saver to have a location load auto-complete field (name or street)
- zip code based locations
in Brazil, zip codes are strictly numeric and summarize state, city, district AND street portion (bigger streets have 2 or more zip codes); this way table location needs to handle just the fields name, number, additional and zip code; the rest of location data will be left for zipcodes table* with the zip code as index
*: this table have no reason to be pre-filled, like UK or US model, as the amount of zip codes is an 8-digit number
- location load auto-complete zipcode field
brazilian location based sites can have their location form with just 3 fields: zip code, number and additional (for locations already in the db);
The project is to make them independent, to be applied combined or not, according the site needs.
Comments, ideas and contributions will be welcome.
Comments
Comment #1
magnus.ramon commentedWhen I said 'patches' I was stupidly referring to new features, not necessarily implemented as patches. Considering the open source vision and Drupal community, remembered by tmcw, I'm thinking the solution for one country only and auto-complete re-use of locations problems as containing module oriented (not sure if containing module is the term form modules wrapped in the main module release).
Here are my ideas:
I'll give a look into the possibility of making multiple countries locations as an option, a containing module for Locations
another optional module, in case the site needs unique locations only
But about district field problem, I'll wrap the open source vision with some of my own thoughts:
the simplicity of this feature is not proportional to the way processing, querying and storage will be increased with a contributed module solution; in this case I think starting with a patch is better to see if there is enough users interested in the feature and then care about making it right
if so, I'm thinking of it as a default feature, reflected this way in db, with a containing module to disable it (including it's column elimination)
At last:
I'll give a look into it only after the other features have been implemented
Again: comments, ideas and contributions are very welcome.
Comment #2
shaneonabike commentedDid you make any progress on any of these?
Comment #3
glottus commentedsubscribe
Comment #4
asxnot commentedSince I urgently needed the autocomplete/reuse feature for my site, this afternoon I developed a preliminary patch starting from the 6.x-3.1 version.
I tested it for my Location CCK field and everything seems to be OK. I do not know if it works for Location Node as well.
Unfortunately I do not know how to make my changes to become a plugin or a submodule of location.
The patch has been done with git. Hope it works :) If not I can attach the two files involved: location.module and location_autocomplete.js
Comment #5
john franklin commentedHere is a re-rolled version of the patch in #4 updated for Location 6.x-3.2.
Comment #6
john franklin commentedLast two patches include a call to dd() in location_save_locations(). This will fail if you don't have the devel module enabled.
Comment #8
john franklin commentedRerolled for 6.x-3.3, minus dd() call.
Comment #11
legolasboClosing old D6 issues as D6 is end of life
Comment #12
legolasboClosing old D6 issues as D6 is end of life