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) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • County Field Not Populating Consistently
Pages: [1] 2

Author Topic: County Field Not Populating Consistently  (Read 3936 times)

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
County Field Not Populating Consistently
January 24, 2012, 03:19:49 pm
Joomla 1.7
CiviCRM 4.0 (upgrade from 3.2)

I have a required field, County, in the Name and Address profile. Existing records display the county selection and you can add a county when creating a new contact record once you have selected the state.

When previewing the profile in CiviCRM » Administer CiviCRM » CiviCRM Profile, even if you select the State, the County field still reads 'select state'.

This profile is used for event registration and uses the Name and Address profile. When test driving the event registration, the county field will not populate once the state is selected.

I created a new profile that uses the County field. Same issue.

Any ideas on how to troubleshoot and resolve this? The county data is in the database table.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: County Field Not Populating Consistently
January 24, 2012, 04:42:04 pm

can u ensure that country / state and county all have the same location type (i.e. home or primary or work) and not a mixture

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
January 25, 2012, 02:30:34 pm
Lobo,

There were some inconsistencies, which I corrected. It still does not work. Maybe I'm misunderstanding something - I thought that the CiviCRM Name & Address Profile was the one used for the Contact record. If that is so, then wouldn't it make sense that if the county field works in the live Contact form, shouldn't it also work in when previewing or using the Name & Address profile via Administer>CiviCRM Profile. Last year, when I worked with this client on an event, I didn't have to do anything special in regards to the County field, other than add the appropriate FL counties to the database. 

The only change from 2011 to today is the upgrade to Joomla and CiviCRM.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: County Field Not Populating Consistently
January 25, 2012, 03:05:43 pm

hmm, we dont use counties in any of the profiles. Also not sure what u mean by CiviCRM Name & Address Profile was the one used for the Contact record. We dont use profiles directly when editing a contact record

You'll need to debug and figure out whats happening and why. Might want to install firebug and see if any of the ajax calls are failing

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
January 27, 2012, 08:28:34 am
Lobo,

When I check the County box under Administer>Global Settings>Address settings the County field appears in the Contact Record and it appears in the Name & Address profile under Administer>Customize>CiviCRM Profile.

If I clear the checkbox under Address Settings, the box is removed from the Contact record and the Name & Address Profile. That tells me the two items are one and the same. What I'm failing to understand is how the field can perform as expected in the Contact Record, but not perform as expected when the Name & Address profile is previewed or used in Administer>Customize>CiviCRM profile or when the profile is used as the primary profile form during an event registration. This feature performed without any problems in CiviCRM 3.3x.

I hope that makes things more clear and thank you very much for your responses.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: County Field Not Populating Consistently
February 04, 2012, 08:33:24 am
I am working on a 3.4.8 installation.  It is true that 'county' select doesn't work properly in 3.4.8, and there is a communications disconnect between the users and the administrators on this issue.  Let me clear this up.

Let me show you how I have found a workaround for this issue.  If you follow these instructions you should be able to get county working in 3.4.8 and not have to wait to upgrade to 4.1.

Editing A Contact
In order for 'county' to work in a 'edit this contact' administrative context such as:
http://<<your-site>>/civicrm/contact/add?reset=1&context=search&action=update&cid=7

You must have all three address fields enabled, 'country', 'state', and 'county' here:
http://<<your-site>>/civicrm/admin/setting/preferences/address?reset=1

Note: It is not necessary for you to make all countries available, a single country such as "United States" only will suffice, so long as the field is present.

Using County in a Profile
In order for 'county' to work in a 'profile' context such as:
http://<<your-site>>/civicrm/profile/create?gid=32&reset=1 (or as an included profile on a registration or contribution page)

You must:
* have all three address fields listed in the profile: 'country', 'state', and 'county'
* AND all three of these fields must be the same address such as "home", or "work" etc.
* AND Country must be before State
* AND State must be before County

Note: It is not necessary for you to make all countries available, a single country such as "United States" only will suffice, so long as the field is present.

I realize that if all your constituents are in a single country it may seem odd/unnecessary to be forced to list country, but this is a quirk of the software in this 3.4 version.

« Last Edit: February 04, 2012, 08:46:37 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: County Field Not Populating Consistently
February 04, 2012, 11:58:59 am

pretty sure this behavior has not changed in 4.1 either.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
February 07, 2012, 08:39:26 am
Thank you both, very, very much. Putting the fields in that order did the trick and it's working fine now.

This is maybe something that should be put in the Wiki(?).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: County Field Not Populating Consistently
February 07, 2012, 09:06:36 am

yes, could you please add it to the wiki :)

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
February 07, 2012, 03:24:48 pm
General Wiki or documentation? Happy to contribute to it, just want to make sure I do it in the correct place.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: County Field Not Populating Consistently
February 07, 2012, 03:42:29 pm

general wiki is good for now. thanx for taking care of this

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
February 09, 2012, 09:28:51 am
Done...

http://wiki.civicrm.org/confluence/display/CRM/CiviCRM+Profile%3A+County+Field+not+Populating+Correctly%2C+Workaround


joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: County Field Not Populating Consistently
July 05, 2012, 12:24:16 pm
I'm having a similar problem in 4.1.3. Can't try it out on the demo site as the county table doesn't seem to be populated.

I've followed the proper order Country/State/County, and maintained the same location type. Changes made in the profile edit are saved to the contact's form, but the county field shows "-select state-" when opening the profile form after a successful save.
--
Joe

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: County Field Not Populating Consistently
July 05, 2012, 12:36:27 pm
You need to import the county values into the civicrm_county table in the database. This can be easily done with a CSV or SQL import using phpMyAdmin (or a similar tool if your webhost does not provide phpMyAdmin). When you import, you will need the county name and the state ID (for your state, look in the civicrm_state_province table for the ID).

joemaine

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 3
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.2
Re: County Field Not Populating Consistently
July 05, 2012, 01:45:58 pm
Hi penguintrax,

I do have the county fields in my database - the CiviCRM demo site doesn't have them loaded.
--
Joe

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • County Field Not Populating Consistently

This forum was archived on 2017-11-26.