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 (Moderator: Dave Greenberg) »
  • AJAX and address-line language determination
Pages: [1]

Author Topic: AJAX and address-line language determination  (Read 1484 times)

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
AJAX and address-line language determination
December 28, 2008, 02:45:21 pm
Hello.

I have a bilingual English-Russian website, where all English pages go to, for example, /en/civicrm/admin, ana all Russian pages go to /ru/civicrm/admin.

This way there is nothing at <my-site>/civicrm/admin, and going to this page redirects to either /ru/civicrm/admin or  /en/civicrm/admin depending on current language of user.

Now when I go to an Individual record, and go to Relationships tab, and press 'Create new relationship', I have a 'Find Target Contact' field there with AJAX functionality connected to it.

When I monitor this page with Firebug, I see the following flow of events:

1. I type "a" in the 'Find Target Contact' field.
2. AJAX issues a command to http://<my-site>/civicrm/ajax/search?rel=12_b_a&name=A%2A&start=0&count=10
3. This command recieves an "301 Moved Permanently" error
4. Automatic redirect goes to http://<my-site>/ru/civicrm/ajax/search?rel=12_b_a&name=A%2A&start=0&count=10, which gives correct results (when I test it in address line)

Seems like AJAX stops working on getting the 301 error, because the drop-down selector is not showing.

When I check the 'Script' tab of Firebug, I see that all links there are defined like http://<my-site>/civicrm/contact/search/basic...

I have tried changing New Base URL in http://<my-site>/civicrm/admin/setting/updateConfigBackend?reset=1

This resulted in all styles being lost (because all styles sit at <my-site>/sites/all... not in <my-site>/ru/sites/all...), and java script not executing - because of wrong path...

Is it possible to make AJAX ignore 301 errors? Or maybe another way is to hard-code somehow all links in civicrm to lead to <my-site>/ru/ instead of <my-site>/   ?

Regards,
Danila


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: AJAX and address-line language determination
December 30, 2008, 10:36:53 am
Danila:

Things to check:

1. Check if you have correct "CIVICRM_UF_BASEURL" in your civicrm.settings.php.
2. Check if your Resource Url is correct. ( Administer CiviCRM >> Global Settings >> Resource Urls)

IMO if above 2 things are correct AJAX / javascript / css should work fine.

HTh

Kurund
Found this reply helpful? Support CiviCRM

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: AJAX and address-line language determination
December 30, 2008, 01:06:56 pm
Hello, Kurund.

I have checked the civicrm.settings.php, and it tells:

Code: [Select]
define( 'CIVICRM_UF_BASEURL'      , 'http://<my-site>/' );
I have changed this line to

Code: [Select]
define( 'CIVICRM_UF_BASEURL'      , 'http://<my-site>/ru/' );
and now everything works as it should. Also I do not get those "301 Moved Permanently" errors, which disturbed me in statistics.

Thanks a lot for help!

Regards,
Danila

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • AJAX and address-line language determination

This forum was archived on 2017-11-26.