Closed (cannot reproduce)
Project:
Hierarchical Select
Version:
6.x-3.7
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Jun 2010 at 12:09 UTC
Updated:
5 Dec 2019 at 14:38 UTC
Jump to comment: Most recent
Comments
Comment #1
klonosAre you sure this is not a duplicate? Do you mean that this only happens with jquery 1.4.2 and not with other versions?
I am asking because there are already a bunch of issues referring to similar issues. Just a search with the terms 'invalid response server' reveals a couple of dozens of them:
http://drupal.org/project/issues/hierarchical_select?text=invalid+respon...
...some are duplicates, others are closed. So, are you sure this has not been reported before?
Comment #2
chawl commentedSame here with jQuery 1.4.2.
In fact this error is specific to all jQuery 1.4.x line. I had no problems with 1.3.2 and older.
Thus confirming.
Comment #3
wim leersSo few reports, so I'm hesitant to think this is a real issue? Can somebody confirm this is still a problem? i.e. jQuery 1.4.x + HS
Comment #4
wim leersClosing due to lack of response. Feel free to reopen.
Comment #5
realityloop commentedIt seems that the trigger events may not be getting fired properly when using jQuery 1.4.2.
If I add
alert('test');after line 579 of hierarchical_select.js then I get an alert after the animation of a changed HS element as expected.However if I add JS to trigger to the page
$('.hierarchical-select-wrapper').bind('change-hierarchical-select', function() { alert('test') });based on the code from API.txt then no alert is triggered.Comment #6
digi24 commentedI am observing a similar problem like realityloop in #5. Strangely this does not happen every time.My problem was caused by empty responses from the json callback and not by the jQuery stuff.Comment #7
glefebvre commentedI think that this issue is due to an incompatibility between jQuery 1.4 and drupal_to_js function (http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_to...). Indeed, jQuery 1.4 seems to use a new method to parse JSON.
drupal_to_js function is used in hierarchical_select.module file (l.362).
In Drupal 7, a new function has been implemented to replace drupal_to_js : drupal_json_encode (http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_js...).
So, in drupal 6 common.inc file (l.2499), replacing
by
seems to solve this issue.
Comment #8
klonos@glefebvre: Are you referring to #479368: D7: Create RFC compliant HTML safe JSON in drupal core?
Comment #9
klonos...never mind. It's #222578: alter drupal_to_js() to use json_encode(), but it is for d7 only and was never suggested to be backported to d6, so I dropped a question there.
Comment #10
klonos...though the patch in that issue removes a whole lot more lines of code and the change is:
return str_replace(array("<", ">", "&"), array('\x3c', '\x3e', '\x26'), json_encode($var));instead of your proposed:
return str_replace(array("<", ">", "&"), array('\u003c', '\u003e', '\u0026'), json_encode($var));Comment #11
wim leersPlease roll a proper patch. I would also like to see reviews from others. Before that happens, I obviously cannot commit this.
I will close this in 2 weeks if the above hasn't happened by then, since this obviously affects very few people. So it may also be a conflict — can this be reproduced on a vanilla Drupal installation?
Comment #12
wim leersClosing due to lack of response.
Comment #13
klonosWim, I am changing this to postponed and I kindly ask you to not close it till I run a few tests (against latest 6.x dev) first and confirm reproduction of the issue or not. Thanx.
PS: btw, jQuery 1.5 is out. I'll check to see how HS works on that too.
Comment #14
wim leersOkay, great! :)
This now goes against the 3.7 release I just made :)
Comment #15
klonosI see no problems so far, but my tests are not on a production environment (with actual data and real traffic I mean). So, I guess we can close it, since if the error comes up again one can re-open this issue.
I didn't have the time to check with latest jQuery 1.5 as promised though. Might do so during the weekend, but I cannot promise anything. Anyways, I guess both developers and ISPs will eventually upgrade to 1.5 and if there are any issues we'll have feedback on them.
PS (for future reference): speed-reading through the issue I see that the issue seems to be occurring only in jQuery 1.4.x setups, so I am tagging it as such.
Comment #16
avpaderno