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

yoda-fr’s picture

I 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.

yoda-fr’s picture

StatusFileSize
new5.02 KB

I 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

yoda-fr’s picture

StatusFileSize
new3.99 KB

I have to do an other organisation.
It is not really fun to do so I share.
Hope it will help.

aurelien-bordeaux’s picture

Title: provinces list is not complete » Merci!

Merci 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?

pieterdc’s picture

stevenpatz’s picture

Title: Merci! » provinces list is not complete
fmjrey’s picture

Category: support » bug
Status: Active » Needs review
StatusFileSize
new6.37 KB
new6.43 KB

Out 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...

yesct’s picture

Title: provinces list is not complete » provinces list is not complete/new location.fr.inc (location.xx.inc)
Status: Needs review » Needs work
+++ supported/location.fr.inc.new	2010-06-03 17:23:02.000000000 +0200
@@ -1,59 +1,140 @@
+    'A08' => "Ardennes (08) ",	

I think there are a bunch of extra trailing spaces at the end of lines. (in both patches)

Powered by Dreditor.

fmjrey’s picture

Ok 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).

fmjrey’s picture

Status: Needs work » Needs review
summit’s picture

Hi Did you use this list to create the new list: http://en.wikipedia.org/wiki/List_of_arrondissements_of_France#Lists_by_...
greetings, Martijn

fmjrey’s picture

No, I used the attached file in comment #3

fmjrey’s picture

The 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

David Stosik’s picture

Subscribing.

Clément’s picture

Assigned: Unassigned » Clément

Thank you very much for this fix!

benjarlett’s picture

Status: Needs review » Needs work

I'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?

Jarode’s picture

Version: 6.x-3.1-rc1 » 6.x-3.x-dev
Assigned: Clément » Unassigned
Status: Needs work » Reviewed & tested by the community

I'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.

Jerome F’s picture

I posted a D7 branch of this issue : http://drupal.org/node/1147774

I think this needs to be commited too, please.

benjarlett’s picture

revisited it and don't know what I did wrong the first time.. cache cleared, works now.

summit’s picture

Hi,

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

podarok’s picture

Status: Reviewed & tested by the community » Postponed

postponed before tests fix
#1931088: [META] Fixing tests

podarok’s picture

Status: Postponed » Needs review

tests fixed #1931088: [META] Fixing tests
lets go

Status: Needs review » Needs work

The last submitted patch, location-fr-provinces-list-is-not-complete-635958-7-r1.7.patch, failed testing.

jim kirkpatrick’s picture

Title: provinces list is not complete/new location.fr.inc (location.xx.inc) » French departments/provinces list not complete in location.fr.inc
Status: Needs work » Needs review
StatusFileSize
new6.39 KB

I've re-rolled the patch for the latest D6 dev branch, attached. If this passes tests I'll roll one for D7.

podarok’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Category: bug » task
Priority: Normal » Critical
Status: Needs review » Patch (to be ported)

#24 commited pushed to 6.x-3.x
Thanks!

This should be rolled for 7.x-3.x

podarok’s picture

Status: Patch (to be ported) » Needs review

Status: Needs review » Needs work

The last submitted patch, france_provinces_complete-635958-24.patch, failed testing.

jim kirkpatrick’s picture

Status: Needs work » Needs review
StatusFileSize
new6.63 KB

Reroll of #24 for D7 3.x-dev attached.

podarok’s picture

Status: Needs review » Fixed

#28 commited pushed to 7.x-3.x
Thanks!

zilla’s picture

i'm confused about why this push resulted in the actual numbers in parens displaying with cities (e.g. Paris (75))

Lccoppee’s picture

Hi,

Why DOM Mayotte disapear from list ?

Lccoppee’s picture

Issue summary: View changes

Updated issue summary.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

zilla’s picture

Issue summary: View changes

why 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)

jim kirkpatrick’s picture

Feel 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.

Lccoppee’s picture

Hi,

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)

podarok’s picture

Status: Closed (fixed) » Needs review

Status: Needs review » Needs work

The last submitted patch, 35: france_provinces_complete_7.x_3.x-635958-35.patch, failed testing.

podarok’s picture

Priority: Critical » Normal

It is not critical

mduvergey’s picture

Status: Needs work » Needs review
StatusFileSize
new6.07 KB

Submitting a new patch that apply the same changes as in #35. Hopefully it will pass :-)

podarok’s picture

Status: Needs review » Fixed

Viva la France!

Committed. Thanks to all.

  • podarok committed eac8545 on 7.x-3.x authored by mduvergey
    Issue #635958 by fmjrey, Jim Kirkpatrick, Lccoppee, mduvergey, yoda-fr:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.