I have Chinese language enabled with path prefix cn setup. It's different from language code: zh-hans.

This is http headers I have captured during debug:

POST /b2b-dev/zh-hans/hierarchical_select_json? HTTP/1.1
Host: devserver
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: application/json, text/javascript, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://devserver/b2b-dev/cn/user/register
Content-Length: 391
.... ...
Pragma: no-cache
Cache-Control: no-cache

As a result browser had received an invalid response from the server:

HTTP/1.x 404 Not Found
Date: Thu, 15 Oct 2009 08:07:55 GMT
Server: Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.2 with Suhosin-Patch
X-Powered-By: PHP/5.2.6-3ubuntu4.2
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Thu, 15 Oct 2009 08:07:55 GMT
Cache-Control: store, no-cache, must-revalidate, post-check=0, pre-check=0
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 869
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
----------------------------------------------------------

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

khorpyakov’s picture

This is a patch which solves the problem for me

Wim Leers’s picture

Status: Active » Needs work

Can you please add some inline documentation to this line?

if (module_exists('i18n') && ($language->prefix != '') && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != "3") {

khorpyakov’s picture

Wim Leers’s picture

Title: POST request is prefixed with language code, not actual language prefix » i18n compatibility: POST request is prefixed with language code, not actual language prefix
Status: Needs work » Fixed

I cleaned up the comments a little bit and didn't test it (not easy to create a setup like this), but committed it. Thanks!

http://drupal.org/cvs?commit=276382

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pacproduct’s picture

Status: Closed (fixed) » Needs review
FileSize
827 bytes

I faced a problem when the language negotiation equals to "LANGUAGE_NEGOTIATION_NONE": The language prefix is added to the JS callback url, and that makes the server respond a 404 error.

To solve that, I suggest this patch that adds the language prefix only when the negotiation is related to path prefix.

David Stosik’s picture

I second this patch. If language negotiation is disabled, Hierarchical Select should not add a prefix language to the URL.

Wim Leers’s picture

Status: Needs review » Fixed

The patch was broken though: sometimes it used $negociation, sometimes $negotiation (notice the wrong spelling of the first variable).

Since the code looked simple enough, I've just made the necessary spelling changes and I think it should be good now :)
Thanks!

http://drupal.org/cvs?commit=350976

sdelbosc’s picture

Just to track the issue...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.