Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Jan 2009 at 03:53 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amccann commentedComment #2
amccann commentedThis is a conflict with the devel module - turning off the module fixes the issue - has to be some js conflict.
Comment #3
doublejosh commentedYup. Agreed.
Comment #4
gappleAs per the devel README.txt: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/devel/READM...
calling drupal_json() instead of drupal_to_js() modifies the Content-Type header to 'text/javascript' and devel no longer appends any data.
Comment #5
gappleMarked #612812: Getting An error occurred popup as duplicate
Comment #6
drumnjo commentedI've successfully applied the patch...
At first, instead of "An http error 0 occured" I got: "(no information available)" but now it's back to "An http error 0 occured"
Any ideas or other patches to apply?
Thanks,
Joe
patching file location.module
Hunk #1 succeeded at 933 (offset 8 lines).
Comment #7
gapple@drumnjo
It looks like you have a separate issue. I can't really tell, but my guess is that you have a configuration problem or a conflicting module.
This patch will fix an issue of a GET request to a path such as
/location/autocomplete/ca/Britishreturning a javascript error since devel.modules appends html to the JSON response:{ "British Columbia": "British Columbia" }<div class="dev-timer"> Page execution time was 33.82 ms. Executed 23 queries in 5.64 milliseconds.</div><div class="dev-memory-usage"><h3>Memory usage:</h3> Memory used at: devel_init()=<strong>0.58</strong> MB, devel_shutdown()=<strong>3.55</strong> MB.</div>On your site, Firebug shows that an OPTIONS request is being performed, and no response is received. A direct request to the page returns a propers JSON response, however it has HTML opening and closing tags appended.
First, try disabling other modules to see if there is a conflict. If you're still having issues you should probably open a separate issue.
Comment #8
drumnjo commentedactually...what file is this command line located?:
input id="edit-province" class="form-text form-autocomplete location_auto_province location_auto_join_country" type="text" value="" name="province" maxlength="64" autocomplete="OFF"/
thanks,
joe
Comment #9
drumnjo commentedalso is there an actual "autocomplete" directory as the error msg implies?
and why would mine be "options" and yours "get"?
'#multiple' => TRUE, //$this->options['multiple'], from location/handlers/location_handler_filter_location_province.inc
does this need to be changed to false?
can you send me a download link to a location module folder or patch that works?
Comment #10
drumnjo commentedmy problem turned out to be stats script pasted into index.php I moved it to page.tpl.php within theme works fine now
Comment #11
gappleFixing status so that patch is still in queue, and updating title.
Comment #12
yesct commentedgapple, (or someone else) please write an updated summary about why this patch is needed, what it does, and a re-roll against the most recent dev version. Also comment on if these changes might cause problems in any other areas of location.
Comment #13
gappleI've attached the re-rolled patch.
Devel appends performance data to all page requests, unless they have their content-type specified as text/javascript. Since location uses `echo drupal_to_js()`, the header is not modified, and so devel appends html code on the end of the JSON data location is returning. This causes a parse error client side, since a valid JSON response is not received.
The `drupal_json()` function performs the same echo operation on the passed data, but also sets the content type header. This patch modifies location modules use of `drupal_to_js()` to `drupal_json()`.
This patch should not cause any conflicts with other areas of location.
Comment #14
yesct commentedwow. this is a 2 line change.
how do you recommend this get tested in order for someone to mark it RTBC?
would a person need to enable the devel module, and then do a performance test...? Please post a step by step of how to test this, that will really help us (uh, at least people like me!) have the confidence to attempt to review it.
Thanks.
Comment #15
bdragon commentedFixed, thanks.
http://drupal.org/cvs?commit=356914
http://drupal.org/cvs?commit=356916
http://drupal.org/cvs?commit=356918