Closed (won't fix)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2011 at 16:59 UTC
Updated:
8 Aug 2011 at 12:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
sportel commentedHi das-peter,
Nice mod. to the module. I can use it as an example for dutch addresses+autocompletion. But would it be possible to use data from a databasetable (with the cities and administrative areas)? I'm sort of a php-noob, so I wouldn't know how to do it, so if someone is willing to give an example, would be nice.
Thanks,
Mike.
Comment #2
das-peter commentedHi sportel,
shouldn't be a problem to do so.
Here's a possible example (don't use as is - it's an untested dummy code ;) )
Comment #3
sportel commentedThank for the quick response. I'll let you know if it works.
Thanks,
Mike.
Comment #4
sportel commentedHi das-peter,
I've tried to apply your patches, but I think the patch-files are incomplete. If I'm correct they should start with the path of the files that need to be patched. Yours don't, wich will probebly be the reason TortoiseSVN can't apply the patches. I don't know enough of patch-files to manually make the correct mods. Can you help?
Thanks,
Mike.
Comment #5
das-peter commentedHi Mike,
I guess TortoiseSVN can't deal with these patches because they're created by git.
Has TortoiseSVN, similar to TortoiseGit, a shell prompt on Windows?
If so, you can maybe use the stand alone patch tool as described here: http://drupal.org/patch/apply
Comment #6
sportel commentedHi das-peter,
Thanks for the help, I used TortoiseGit and that worked. Now I'm trying to figure out how to use your example for using a databasetable for autocompletion. But to be honest, I have no idea where to put it (in the original files ofcourse, not in the patched ones). Any help would be appriciated (I really should follow some php training or something).
Thanks,
Mike.
Comment #7
gagarine commentedYou use "premise" as a street number. But is not the case, this field is commonly know as "address 2" (I know is confusing). The street's number is in the same field than "Street" (again I think is confusing and the label should be "Street and number" or like amazon a small help under the field).
I also had a hard time to applied your patch. I needed to use patch -p0 instead of the habitually -p1.
Comment #8
gagarine commentedmmmh perhaps you right in fact. So I will say "i don't know". but a field for the number is strange for me and not really useful.
Comment #9
das-peter commentedJust took a look into the xNAL standard docs - but what I found just confuses me even more :)
^^ http://xml.coverpages.org/XNAL-DTDs-display.html
But then there's also the element
ThoroughfareNumberin http://xml.coverpages.org/XNAL-Examples-200203.html which seems to fit even better.Besides that it looks like the usage of the
premisefield is quite inconsistent in the module.Maybe DamZ can enlighten us :)
Comment #10
sportel commentedAnd there is even the element 'ThoroughfareNumbersuffix', for addresses like "Mainstreet 234-B", wich is quit commonly used in the Netherlands. By breaking down the address by using Thouroughfare, ThouroughfareNumber and ThouroughfareNumber the validation of the input can be made much better. Also, it'll make the use of an addressdatabase (and autocompletion) much easier.
Comment #11
gagarine commented@sportel by breaking down you also think of the user input or only storage? I hate form with tone of field, specially because a lot of user use mouse to select field (slow).
We should be able to have one input field for street addressee like "Chemin des grottes 2b". It's not so easy to break that in different field. In USA number can be at the begining "1600 Amphitheatre Pkwy" that's all right... but what about:
"1600A Amphitheatre Pkwy"
"1600-A Amphitheatre Pkwy"
"1600 A Amphitheatre Pkwy"
"Amphitheatre Pkwy 1600 A"
"Amphitheatre Pkwy 1600.A"
Yeah user do wired thinks like that all the time...
And what if a street name is "A nice avenue" so we can have "34 A A nice avenue".
Do you think we can/should split that in different database field without any risk of mess? Perhaps we should just give the two possibility... But this is really important than we go in the same direction and I will like to have DamZ point of view too.
Comment #12
valderama commentedwould be nice to see those mods and additions in the next release :)
Comment #13
sportel commentedHi gagarine,
Thanks for your reply. It all kind of depends on what you want with your drupal-based website/webapplication. For a webapplication in a more professional environment, it would probebly be more important to have all the data, like addresses, validated, or at least as clean and uniform as possible. And in my oppinion that is only possible by breaking down the input, or at least not having a complete address input in only one field.
Further, by breaking down the input, it'll be easier to query the addresses. Like for example: select all the users in a certain city.
And, something thats important for me: in the netherlands there are databases available with all the provinces, cities, postalcodes, streetnames and numbers. It is possible to get all the right address-information from such a database by only giving the postalcode and housenumber. The rest would be autocompleted. (Thats a feature I would like to see in this module as well, and I'm busy with that, but It's hard for me since I'm really a php-noob)
BTW, your example "34 A A nice avenue" would have to be entered like:
Thoroughfare (Streetname): A nice avenue
ThoroughfareNumber (Number): 34
ThoroughfareNumbersuffix (Suffix): A
Hope this explanes my point of view.
Comment #14
das-peter commentedPatch rerolled.
Comment #15
das-peter commentedFixed missing comma.
Comment #16
das-peter commentedFixed possible unnecessary line break in address formatters.
array_filterwon't work as needed if not$address['name_line']is used since there will be always a whitespace:!empty($address['name_line']) ? $address['name_line'] : $address['first_name'] . ' ' . $address['last_name'],Changed code:
trim((!empty($address['name_line']) ? $address['name_line'] : $address['first_name'] . ' ' . $address['last_name'])),Comment #17
damien tournoud commentedThe
-reloadedbranch has been merged. It has reasonable defaults for Switzerland. I don't believe the autocomplete is in the scope of this module.For reference, here is how to implement this patch in the new plugin system.
Comment #18
sportel commentedHi Damien,
I tried your address-ch.inc as an example. But I don't get any autocompletion when entering postalcode (chosen from the list in address-ch.inc). To test this add-on I made a content type with a addressfiels, with the adress form (both the country specific and the CH add-on) set as format handlers. I asume this is the correct way?
Thanks,
Mike.
Comment #19
Loikkk commentedHi,
I would like to know if it is possible to fetch all these datas directly from Google Maps for a more flexible feature?