This issue is part of meta issue #1931088: [META] Fixing tests
Hey there,
In location.module, I have made some change to display all the french provinces in a list :
case 'province':
$options = array_merge(array('' => t('Selectionnez...'), 'xx' => t('AUTRES')), location_get_provinces('fr'));
$country = $a5['country'] ? $a5['country'] : variable_get('location_default_country', 'us');
return array(
'#type' => 'select',
'#title' => t('State/Province'),
'#default_value' => $obj,
'#options' => $options,
'#description' => NULL,
'#required' => ($a4 == 2),
);
Not all the provinces are listed. It is the same problem with the drupal "autocomplete".
Do you know what can I do to display entire french provinces ?
Thanks for your help!
Comments
Comment #1
yoda-fr commentedI have found that in supported/location.fr.inc :
<?php
// $Id: location.fr.inc,v 1.7 2008/10/09 15:27:17 bdragon Exp $
// France
function location_province_list_fr() {
return array(
'A67' => "Bas-Rhin - Alsace",
'A68' => "Haut-Rhin - Alsace",
'B24' => "Dordogne - Aquitaine",
'B33' => "Gironde - Aquitaine",
'B40' => "Landes - Aquitaine",
'B47' => "Lot-et-Garonne - Aquitaine",
'B64' => "Pyrenees-Atlantiques - Aquitaine",
'B79' => "Deux-Sevres - Aquitaine",
'C03' => "Allier - Auvergne",
'C15' => "Cantal - Auvergne",
'C43' => "Haute-Loire - Auvergne",
'C63' => "Pu-de-Dme - Auvergne",
'D21' => "Cote-d'Or - Bourgogne",
'D58' => "Nievre - Bourgogne",
'D71' => "Saone-et-Loire - Bourgogne",
'D89' => "Yonne - Bourgogne",
'E22' => "Cotes-d'Armor - Bretagne",
'E29' => "Finistere - Bretagne",
'E35' => "Ille-et-Vilaine - Bretagne",
'E56' => "Morbihan - Bretagne",
'F18' => "Cher - Centre",
'F28' => "Eure-et-Loir - Centre",
'F36' => "Indre - Centre",
'F37' => "Indre-et-Loire - Centre",
'F41' => "Loir-et-Cher - Centre",
'F45' => "Loiret - Centre",
'G08' => "Ardennes - Champagne-Ardenne",
'G10' => "Aube - Champagne-Ardenne",
'G51' => "Marne - Champagne-Ardenne",
'G52' => "Haute-Marne - Champagne-Ardenne",
'H2A' => "Corse-du-Sud - Corse",
'H2B' => "Haute-Corse - Corse",
'I25' => "Doubs - Franche-Comte",
'I39' => "Jura - Franche-Comte",
'I70' => "Haute-Saone - Franche-Comte",
'I90' => "Haute-Saone - Territoire de Belfort",
'J75' => "Paris - Ile-de-France",
'J77' => "Seine-et-Marne - Ile-de-France",
'J78' => "Yvelines - Ile-de-France",
'J91' => "Essonne - Ile-de-France",
'J92' => "Hauts-de-Seine - Ile-de-France",
'J93' => "Seine-Saint-Denis - Ile-de-France",
'J94' => "Val-de-Marne - Ile-de-France",
'J95' => "Val-d'Oise - Ile-de-France",
'U04' => "Alpes-de-Haute-Provence - Provence-Alpes-Cote d'Azur",
'U05' => "Hautes-Alpes - Provence-Alpes-Cote d'Azur",
'U06' => "Alpes-Maritimes - Provence-Alpes-Cote d'Azur",
'U13' => "Bouches-du-Rhone - Provence-Alpes-Cote d'Azur",
'U83' => "Var - Provence-Alpes-Cote d'Azur",
'U84' => "Vaucluse - Provence-Alpes-Cote d'Azur",
);
}
Can I add letter and numbers I want (i.e 'X50' => "Manche - Basse-Normandie" ) or the code (i.e U84) is correspoding to something?
I will test and post a complete list if it works.
Comment #2
yoda-fr commentedI have enter all the french provinces and it seems to work. (don't forget to clear location cache in your database to see the changes)
No time to work on special character, sorry...
Thanks to all the exemples and sources found on the web
Comment #3
yoda-fr commentedI have to do an other organisation.
It is not really fun to do so I share.
Hope it will help.
Comment #4
aurelien-bordeaux commentedMerci Yoda pour cette liste.
If we want to go further and have autocomplete based on zip code or city... What would be the next thing to do with the file?
Comment #5
pieterdcThen you'd have to look at #404830: Location autocomplete implementation for cities
Comment #6
stevenpatzComment #7
fmjrey commentedOut of the attached file in comment #3 I created two patch files, one for 3.1RC1, and the other for head (as of writing this post). Hopefully this will make it into next release...
Comment #8
yesct commentedI think there are a bunch of extra trailing spaces at the end of lines. (in both patches)
Powered by Dreditor.
Comment #9
fmjrey commentedOk I removed these extra spaces from the patch files by editing the patch files themselves.
Should work, but just in case, make backups before applying (as you should anyway).
Comment #10
fmjrey commentedComment #11
summit commentedHi Did you use this list to create the new list: http://en.wikipedia.org/wiki/List_of_arrondissements_of_France#Lists_by_...
greetings, Martijn
Comment #12
fmjrey commentedNo, I used the attached file in comment #3
Comment #13
fmjrey commentedThe patched file hasn't changed in 20 months so patch from #9 should work on 6.x-3.1 as well.
Would be nice to have it released next time
Comment #14
David Stosik commentedSubscribing.
Comment #15
Clément commentedThank you very much for this fix!
Comment #16
benjarlett commentedI'm trying to add the province for Bozel (a commune in the Savoie department in the Rhône-Alpes region in south-eastern France) neither Savoie nor Rhône-Alpes appears. I tried the patch in #9 which appeared to patch when I ran it (the file updated), I cleared my cache... but still no joy. Can anyone help?
Comment #17
Jarode commentedI'm not familiar with drupal validation process for patches but it's been more than 1 year since this issue is opened, fixed, but not committed to head. :-(
All patches and attachments provided in this thread are perfect !
Thank you very very much.
Comment #18
Jerome F commentedI posted a D7 branch of this issue : http://drupal.org/node/1147774
I think this needs to be commited too, please.
Comment #19
benjarlett commentedrevisited it and don't know what I did wrong the first time.. cache cleared, works now.
Comment #20
summit commentedHi,
This is still not committed. Latest dev the French provinces are still not complete.
What needs to be done to get this quickly committed please?
Thanks a lot in advance for your reply.
greetings, Martijn
Comment #21
podarokpostponed before tests fix
#1931088: [META] Fixing tests
Comment #22
podaroktests fixed #1931088: [META] Fixing tests
lets go
Comment #24
jim kirkpatrick commentedI've re-rolled the patch for the latest D6 dev branch, attached. If this passes tests I'll roll one for D7.
Comment #25
podarok#24 commited pushed to 6.x-3.x
Thanks!
This should be rolled for 7.x-3.x
Comment #26
podarok#24: france_provinces_complete-635958-24.patch queued for re-testing.
Comment #28
jim kirkpatrick commentedReroll of #24 for D7 3.x-dev attached.
Comment #29
podarok#28 commited pushed to 7.x-3.x
Thanks!
Comment #30
zilla commentedi'm confused about why this push resulted in the actual numbers in parens displaying with cities (e.g. Paris (75))
Comment #31
Lccoppee commentedHi,
Why DOM Mayotte disapear from list ?
Comment #31.0
Lccoppee commentedUpdated issue summary.
Comment #33
zilla commentedwhy are numbers still appearing by city or province name for france in this most recent patch?
for example: "La Reunion (974) " displays exactly like that, with the (974)
Comment #34
jim kirkpatrick commentedFeel free to submit a patch that takes out the ()... I copied the departments from somewhere that bracketed department number.
http://en.wikipedia.org/wiki/Departments_of_France seems like a sensible source.
Comment #35
Lccoppee commentedHi,
I listen and make a new location.fr.inc based on wikipedia, I have change ids no more "A01" but the code of the departement (and delete it from the name)
Comment #36
podarokComment #38
podarokIt is not critical
Comment #39
mduvergey commentedSubmitting a new patch that apply the same changes as in #35. Hopefully it will pass :-)
Comment #40
podarokViva la France!
Committed. Thanks to all.