Allow domain_geolocalization location fields to be passed as node locations
| Project: | Domain GeoLocalization |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
If you specify a field in domain_geolocalization settings for a domain, this patch will hide the relevant location field in the node edit form and automatically populate it with your domain_geolocalization settings. If you leave domain_geolocalization fields empty, then they will appear in the node edit form as normal.
Example: say I have one domain per country. If I specify that country as Ireland for a domain, then when a user creates a page on that domain, then in the Location fieldset he can still select Address and City ect, but the country will be hidden and automatically set to Ireland.
Unfortunately, it relies on a one-line patch to location module (which hopefully will be committed soon), which enables us to hook into the location form (form_alter doesnt work there apparently): http://drupal.org/node/381458#comment-2127762
There are still outstanding issues, which I wanted to get feedback from before proceeding:
1. Geolocalization must be enabled for a domain (and by implication latitude, longtitude, radius, and gmaps api must be set) in order for me to fill in a city, state or country field. In my patch, I have temporarily commented out this validation in domain_geolocalization_domainupdate. It would be great if the non required fields could be enabled independent of whether the geolocalization is enabled or not, and the settings form clarified accordingly.
2. Right now, country must be entered in country code format, as that is the way it is stored in Location table, but that can be easily got around.
3. Only dealt with city, country, state and zipcode right now, not sure where latitude and longtitude fits into the whole picture (if you have latitude and longtitude specified, you may as well disable location altogether :) )
I know this adds on something slightly additional to what the module is intended for, but I would rather not confuse people by creating another module, when the functionality could be accomodated here with some minimal furniture rearranging.
| Attachment | Size |
|---|---|
| domain_geolocalization_location_fields.patch | 2 KB |
