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) »
  • "State" drop-down not populated when "Country" changed in public search
Pages: [1]

Author Topic: "State" drop-down not populated when "Country" changed in public search  (Read 1841 times)

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
"State" drop-down not populated when "Country" changed in public search
June 06, 2014, 09:37:45 pm
On my public member search on WordPress, there is a JavaScript/AJAX syntax error when you change the Country drop-down, causing the Province/State drop-down to not get updated (see screenshot).

If I click Search anyway (after selecting a Country), then the states or provinces DO get populated. However, if I then select a province and click Search again, the results are not filtered by province and the province field has no selection UNLESS/UNTIL I do a Shift+Reload (in Firefox and Chrome). This is after turning off smart group caching and varnish caching.

Posting here in case it's something I'm doing wrong, and also, I'm not familiar with the Issue tracker yet (it's a bit daunting, although I did search there first to see if this is a known issue).

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed in public search
June 11, 2014, 05:49:13 pm
This bug also occurs on my public Member Signup and Renewal contribution page.

I found a work-around for my member directory search however: I realized I don't need the Country drop-down for this particular directory, and there is an option under Administer > Localization to show the states of only one country when the Country select is not used on a profile.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "State" drop-down not populated when "Country" changed in public search
June 14, 2014, 12:07:44 am
Are you able to replicate this on http://wordpress.sandbox.civicrm.org

Kurund
Found this reply helpful? Support CiviCRM

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed in public search
June 14, 2014, 02:02:13 pm
Thank you for replying Karund. Yes, I just did a quick test: I changed the Localization settings to include Canada and its provinces. So now if you go to the Membership page (http://wordpress.sandbox.civicrm.org/membership-page/) and change the Country it just says "Loading..." for the State.

In the Firebug Net panel I see this error in the response for the ajax call:

Fatal error: Call to undefined function wp_get_current_user() in /home/webeditor/jenkins-node/workspace/buildkit-demos.civicrm.org/build/wp-sandbox/wp-includes/capabilities.php on line 1342

In fact, you can look at the request/response directly:

http://wordpress.sandbox.civicrm.org/?page=CiviCRM&q=civicrm/ajax/jqState&&_value=1228 (United States)
http://wordpress.sandbox.civicrm.org/?page=CiviCRM&q=civicrm/ajax/jqState&&_value=1228 (Canada)

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed in public search
June 14, 2014, 02:13:50 pm
Appears to be related to this issue http://forum.civicrm.org/index.php?topic=29169.0 which was fixed (https://issues.civicrm.org/jira/browse/CRM-12916), and I confirmed that the Drupal version works here: http://drupal.demo.civicrm.org/civicrm/event/register?reset=1&id=3

So this is probably unique to WordPress, which the error above does seem to indicate. I guess I should learn how to file a bug.

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed [SOLVED]
June 14, 2014, 03:13:31 pm
Somebody already filed a bug and patch for this: https://issues.civicrm.org/jira/browse/CRM-14631

I confirmed that it works.
« Last Edit: June 15, 2014, 03:08:27 pm by Wes Reimer »

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed in public search
June 19, 2014, 07:38:16 pm
Another update: the fix only works if the page is not encrypted. The ajax call is http: so it doesn't work if your page is https:

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: "State" drop-down not populated when "Country" changed in public search
June 23, 2014, 11:02:18 am
Tried to "Force Secure URLs" to get the ajax to work, but it seems like there's a bug with that too (see http://forum.civicrm.org/index.php/topic,28043.msg120304.html and https://issues.civicrm.org/jira/browse/CRM-14744 and https://issues.civicrm.org/jira/browse/CRM-13227). I will post a separate topic.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • "State" drop-down not populated when "Country" changed in public search

This forum was archived on 2017-11-26.