CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to populate (add) a state to the drop-down menu
Pages: [1]

Author Topic: How to populate (add) a state to the drop-down menu  (Read 5139 times)

mangoman

  • Guest
How to populate (add) a state to the drop-down menu
May 23, 2009, 12:02:56 am
Mexico is missing an angel a state - and I'm not sure how/where to add an additional state into the database. Can someone please provide some guidance?

Thanks,
John


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: How to populate (add) a state to the drop-down menu
May 23, 2009, 01:43:21 am
Try the civicrm_state_province table - but it there is an official state missing you should possibly file a bug.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

mangoman

  • Guest
Re: How to populate (add) a state to the drop-down menu
May 23, 2009, 05:30:35 am
Thanks. I added another state to the table as:

ID [blank]
Name Distrito Federal
Abbreviation DF
Country ID 1140 [Mexico]

The state was successfully created and Distrito Federal is assigned ID #10004, yet it doesn't show up in the table when I do a search for Mexico's country ID of 1140. It DOES, however, show up in the CiviCRM admin and I am able to update/correct the State field for our default address. Hooray!

Thanks for your help. I'll track down the bug report & add this.
John

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to populate (add) a state to the drop-down menu
May 25, 2009, 03:39:11 am
As you can see in the relevant commit, I added ‘Federal District’ (this is the common name I found at the ISO_3166-2:MX Wikipedia page, and one that does not conflict with the Brasilian province of ‘Distrito Federal’) with id of 5218.

If you want to make your database future-compatible with the least hassle when you upgrade to CiviCRM 2.3, you might want to run the below queries and delete your province of id = 10004:

Code: [Select]
INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES (5218, 1140, "DIF", "Federal District");
UPDATE civicrm_state_province SET name = "Coahuila"  WHERE id = 3808;
UPDATE civicrm_state_province SET name = "Colima"    WHERE id = 3809;
UPDATE civicrm_state_province SET name = "Chihuahua" WHERE id = 3811;
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

mangoman

  • Guest
Re: How to populate (add) a state to the drop-down menu
May 25, 2009, 04:48:30 am
Thanks, but on that Wiki page you'll see that the official name is "Distrito Federal" (Spanish) and not Federal District (English). Local users would be irritated to choose an English-language state-province.

Rather, you might want to refer to:
http://es.wikipedia.org/wiki/ISO_3166-2:MX

Thanks,
John

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: How to populate (add) a state to the drop-down menu
May 25, 2009, 05:52:40 am
Quote from: mangoman on May 25, 2009, 04:48:30 am
Thanks, but on that Wiki page you'll see that the official name is "Distrito Federal" (Spanish) and not Federal District (English). Local users would be irritated to choose an English-language state-province.

Ok, re-fixed in r21423. :)

Should we stick with the three-letter ISO codes for the provinces, or would it make more sense (e.g., for postal reasons) to use the two-letter codes?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

mangoman

  • Guest
Re: How to populate (add) a state to the drop-down menu
May 25, 2009, 12:16:28 pm
The 3-letter codes are commonly used here, so I would recommend it. Funny thing, though, is that the DF is the exception to that rule; not even the post office promotes the ISO 3-letter standard for the Distrito Federal but *does* for the other states. Ahh, life in Mexico. =-)

Thanks,
John

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • How to populate (add) a state to the drop-down menu

This forum was archived on 2017-11-26.