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) »
  • Problems with State Field When Editing a Profile in Drupal
Pages: [1]

Author Topic: Problems with State Field When Editing a Profile in Drupal  (Read 1156 times)

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Problems with State Field When Editing a Profile in Drupal
January 18, 2013, 11:11:33 am
I have a Civi Profile which shows up on the contacts drupal/user page. When on a user page for someone living outside of the United States, the "State" field is empty (even though it is filled in the Civi Contact). This is true both when viewing and editing the profile on the Drupal/user page.

If you click the drop-down, the states there are the US states.

The country is right. To get the right set of states the user must change the country to a different country, and then choose the correct country again in order for the right list of states to appear.

And remember, all this data is correct in the Civi Contact Record.

Any idea of what is going on here?

The uses Drupal 7.17 and CiviCRM 4.1.6.

Thanks,

Shai Gluskin
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

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: Problems with State Field When Editing a Profile in Drupal
January 18, 2013, 11:54:54 am

can you check on our demo server and see if this is still the case with the latest version of 4.2

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

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: Problems with State Field When Editing a Profile in Drupal
January 18, 2013, 12:10:13 pm
Lobo,

Yes, I just was able to reproduce the problem in 4.2 at the demo server.

This is what I did:
  • Logged in to the demo account
  • navigated to: http://drupal.demo.civicrm.org/user/4/edit/Name%20and%20Address
  • Added "Australia" to Country field and "Victoria" to state field
  • Save
  • "Changes Saved" message appears. "Australia" is correct but for State, it says "Select" and the available states are the ones for Viet Nam, which appears to be the default on the demo site now.
  • I checked the contact record for "Demo" in Civi and the address field added the correct data for both "Australia" and "Victoria" to the correct CiviCRM record.

Any ideas?

Thanks much,

Shai
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

kennedy

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 5
  • CiviCRM version: 4.5.5
  • CMS version: Drupal
  • PHP version: 5.3.10
Re: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 10:37:29 am
Hi Shai,
go to civicrm, navigate to administer -> localization -> Languages, Currency, Locations and set the Default Country to -Select- (from the dropdown of countries where it says "Contact Address Fields - Selection Values").
Hope that helps.

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 11:17:25 am
Hi @kennedy,

Thanks for the suggestion.

However, the issue isn't choosing a default country. The issue is editing non-US addresses via a profile on a Drupal user page.

Lobo, since I have verified this in the demo, should I file a bug report?

Shai
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

kennedy

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 5
  • CiviCRM version: 4.5.5
  • CMS version: Drupal
  • PHP version: 5.3.10
Re: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 12:10:05 pm
The default country is now set to select on the demo site. Can you try again the link on the demo site?
http://drupal.demo.civicrm.org/user/4/edit/Name%20and%20Address

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 01:22:22 pm
@Kennedy,

Thank you!!!!l

I do think this constitutes a bug. Or at least there should be a warning like "Setting a default country will cause problems when profiles are used" or something like that.

Shai
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

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: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 03:34:30 pm

shai:

can u please take a look at the code and see if you can figure out whats happening and why and contribute a patch that fixes the issue

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

Shai

  • I post frequently
  • ***
  • Posts: 202
  • Karma: 8
    • Content2zero
  • CiviCRM version: 4.3.x, 4.4.x, 4.5.x
  • CMS version: Drupal 7
  • MySQL version: 5.5.x
  • PHP version: 5.3.x, 5.4.x
Re: Problems with State Field When Editing a Profile in Drupal
January 20, 2013, 05:35:30 pm
Hi Lobo,

I'm not familiar with Civi code. Can you give me a head start by pointing me to the most likely places where the problem is.

Thanks,

Shai
Don't miss out! Sign up now for free expert advice on CiviCRM's new StackExchange help site.

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: Problems with State Field When Editing a Profile in Drupal
January 21, 2013, 03:01:31 pm

1. check http://book.civicrm.org/developer

2. Most of this is in profile related code, so files starting with CRM/Profile/*

3. You should check if a standalone profile exhibits the same behavior or if its just a profile embedded in drupal's my account page

you can ping folks on irc if you have any specific questions

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

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: Problems with State Field When Editing a Profile in Drupal
February 01, 2013, 11:23:19 am

filed and fixed for 4.3:

http://issues.civicrm.org/jira/browse/CRM-11811
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Problems with State Field When Editing a Profile in Drupal

This forum was archived on 2017-11-26.