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 CiviEvent (Moderator: Yashodha Chaku) »
  • Location Ajax not working
Pages: [1] 2

Author Topic: Location Ajax not working  (Read 4098 times)

SnowB1

  • Guest
Location Ajax not working
January 20, 2009, 07:46:03 am
I am using CiviCRM 2.2 with Drupal and anytime I choose the United States for the country the State/Province drop-down goes empty. Using Firebug it looks like the ajax call does not return any items. I have disabled firebug as well as jQuery ui in hopes that there was a conflict and I didn't recieve any. I have also unchecked many of the modules I have installed to see if one of them was causing a conflict. I was wondering if anyone has had the same issue or knows of a fix. Thanks in advance.

SnowB1

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: Location Ajax not working
January 20, 2009, 09:11:42 am
Can you give exact details to replicate the problem? (url's might help)  If possible do try to replicate it on http://sandbox.civicrm.org

Kurund
Found this reply helpful? Support CiviCRM

SnowB1

  • Guest
Re: Location Ajax not working
January 20, 2009, 11:36:29 am
Well I was unable to reproduce the error at the sandbox site. So I started looking over some of the configuration options and it all seems to be where it should. Using firebug I have located the issue to be in /civicrm/packages/jquery/plugins/jquery.chainedSelects.js on line 53. It seems like the eval() does not exist. I did a search through the directory starting at the civicrm level and did not find anything.  Is there something I could possibly be missing?  The address after my site is index.php?q=civicrm/admin/event&reset=1&action=update&id=3&subPage=Location (sorry I don't have clean urls on yet).

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: Location Ajax not working
January 20, 2009, 11:59:16 am
Seems to be working fine for non-clean urls. No idea why eval() fails, i am using FireFox 3.0.5

Kurund
Found this reply helpful? Support CiviCRM

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Location Ajax not working
January 20, 2009, 12:46:47 pm
Are you saying that when you load the URL which the country form field calls when you change the value to United States - in a separate browser window - you get an empty page?

EXAMPLE: Firebug shows me this GET URL under "Console" on my localhost install:

http://localhost/dgg/drupal6t/civicrm/ajax/jqState?_id=location_1_address_country_id&_name=location[1][address][country_id]&_value=1228

... and if I load that in a separate window I see a list of US states:

{"name":"Alabama","value":1000},{"name":"Alaska","value":1001} ...
Protect your investment in CiviCRM by  becoming a Member!

SnowB1

  • Guest
Re: Location Ajax not working
January 20, 2009, 01:10:23 pm
No. What is happening is when I am in the Event Location, I select the United States for the Country and then I do not get any States/Providences to choose from. The select box goes empty and I get the javascript error saying that the function eval does not exist. I am also using Firefox 3.0.5 in linux. The error displayed in fire bug is
Code: [Select]
<b>Fatal error</b>: Call to undefined f...cation.php</b> on line <b>117</b><br />\n Which I thought was the eval since when I copy the error and put it into my text editor I get
Code: [Select]
missing ; before statement
http://drupal6.bsnow.progdevel.velocity.net/sites/all/modules/civicrm/packages/jquery/plugins/jquery.chainedSelects.js
Line 54
These are those lines
Code: [Select]
52 $(target).html("");
 53 data = eval(data);
 54 if (data != null) {
Any ideas?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Location Ajax not working
January 20, 2009, 01:27:55 pm
Hi

Looks like the ajax function called is not working. Use firebug and the net tab to find what is the one called, and call it by hand to see the detail of the php error you seem to get.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

SnowB1

  • Guest
Re: Location Ajax not working
January 20, 2009, 01:55:07 pm
Thanks Guys! I kinda found it. For some reason it is saying json_encode not found which would happen in an older version of php but we are running 5.2.6. I will have to see if maybe there is an issue in our php settings. Thanks again!

wmena

  • Guest
Re: Location Ajax not working
March 27, 2009, 02:51:26 am
Did you ever get a resolution to this?

This still seems to be an issue (at least for me).  In my case, I'm using Joomla 1.59 and Civicrm 2.2. 

When I go to the membership/contribute screen (specifically the billing section... which I cannot change via control panel), I see the state pulldown.  But, if I select United States, an ajax call is made, then the state field goes blank.

Here is where the call is made:

https://www.<mysite>.com/membership/index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=country_id-5&_name=country_id-5&_value=1228

Anyone else see this?

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: Location Ajax not working
March 27, 2009, 07:16:45 am

1. can you install firebug on your browser and see what the ajax call returns etc. That might give you/us a clue

2. can you reproduce this on our joomla demo (http://joomla.demo.civicrm.org/)

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

wmena

  • Guest
Re: Location Ajax not working
March 27, 2009, 08:12:58 am
Quote from: Donald Lobo on March 27, 2009, 07:16:45 am
1. can you install firebug on your browser and see what the ajax call returns etc. That might give you/us a clue

I use firebug quite a bit, but I'm not 100% sure how to see what the call returns.  Can you tell me?  I believe that the following is the call... and possibly it is returning nothing:

https://www.<mysite>.com/membership/index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=country_id-5&_name=country_id-5&_value=1228

But, whenever I look at the firefox error log, it shows this right after I change the country:

Error: syntax error
Source File: https://www.<mysite>.com/administrator/components/com_civicrm/civicrm/packages/jquery/plugins/jquery.chainedSelects.js
Line: 53
Source Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Quote
2. can you reproduce this on our joomla demo (http://joomla.demo.civicrm.org/)

Nope.  Seems to work without any problems on the test server.
« Last Edit: March 27, 2009, 08:14:32 am by wmena »

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: Location Ajax not working
March 27, 2009, 08:33:23 am

check:

http://joomla.demo.civicrm.org/administrator/components/com_civicrm/civicrm/packages/jquery/plugins/jquery.chainedSelects.js

note that there is no DOCTYPE line on that file. so wondering if something in your server s injecting that line?

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

wmena

  • Guest
Re: Location Ajax not working
March 27, 2009, 09:17:18 am
Quote from: Donald Lobo on March 27, 2009, 08:33:23 am

check:

http://joomla.demo.civicrm.org/administrator/components/com_civicrm/civicrm/packages/jquery/plugins/jquery.chainedSelects.js

note that there is no DOCTYPE line on that file. so wondering if something in your server s injecting that line?

lobo

Yea... good idea... but I did that already.  Copied that file and used it on my site.  Still a problem.  Happens also whether I run in SSL or not.

Not sure where that DOCTYPE is coming from. 

If you can tell me how to see the AJAX return using firebug, I'd greatly appreciate it.

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: Location Ajax not working
March 27, 2009, 10:19:31 am

1. get firebug going on the url u r debugging

2. see console tab

3. click on url u r interested in

4. click response sub-tab

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

wmena

  • Guest
Re: Location Ajax not working
March 27, 2009, 10:23:24 am
Quote from: Donald Lobo on March 27, 2009, 10:19:31 am

1. get firebug going on the url u r debugging

2. see console tab

3. click on url u r interested in

4. click response sub-tab

lobo

Thanks.  I was finally able to figure out how to do that.

I am getting closer to a solution.  Seems to have something to do with Joomla SEF. 

The actual ajax call is supposed to be:

  /index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=country_id-5&_name=country_id-5&_value=1228

And that returns the data correctly if I call it manually on my site. 

But, my site is calling the ajax this way:

  /membership/index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=country_id-5&_name=country_id-5&_value=1228

Which is returning an entire page.

I'll continue digging.


Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Location Ajax not working

This forum was archived on 2017-11-26.