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
----------------------------------------------------------
Comment | File | Size | Author |
---|---|---|---|
#6 | patch-hierarchical_select-path-negotiation.patch | 827 bytes | pacproduct |
#3 | patch-hierarchical_select-path-negotiation.txt | 1.47 KB | khorpyakov |
#1 | patch-hierarchical_select.txt | 1.38 KB | khorpyakov |
Comments
Comment #1
khorpyakov CreditAttribution: khorpyakov commentedThis is a patch which solves the problem for me
Comment #2
Wim LeersCan you please add some inline documentation to this line?
if (module_exists('i18n') && ($language->prefix != '') && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != "3") {
Comment #3
khorpyakov CreditAttribution: khorpyakov commentedUpdated
Comment #4
Wim LeersI 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
Comment #6
pacproduct CreditAttribution: pacproduct commentedI 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.
Comment #7
David Stosik CreditAttribution: David Stosik commentedI second this patch. If language negotiation is disabled, Hierarchical Select should not add a prefix language to the URL.
Comment #8
Wim LeersThe 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
Comment #9
sdelbosc CreditAttribution: sdelbosc commentedJust to track the issue...