I have noticed on my site that when I attempt to use an ajax enabled auto complete form, for example changing the author of a post under authoring information, I get the An Http Error 0 has occurred every time I enter a letter and auto complete never works.
I have also found something else out a few minutes ago and that this error only happens to me when attempting to use auto complete from a secured web page (https).
If I load the page with a regular http, I found out that the error goes away and the auto complete works like it should.
On the https page, the auto complete script is still trying to access http, which isn't secured, which is causing this error, there ought to be someway to tell Drupal that if the current page being served is sent https, then the calls to the scripts should also be https instead of http.
Anyway, under https this error only occurs in Firefox, however, auto complete will never finish in IE7 and up it just sits there spinning but no error pops up. Again, when the site is a normal http page, it works fine in IE7 as well.
I have attached two files to this for an example, one shows the error on an https page, and the other shows auto complete working just fine on the same page served up http.
Any ideas or work arounds appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| autocomplete_no_ssl.gif | 72.71 KB | imatechie | |
| autocomplete_ssl_error.gif | 76.35 KB | imatechie |
Comments
Comment #1
lancast commentedI am having the same problem, same errors. Turning Secure Pages off fixes the problem, but we need to have Secure pages turned on. I've tried different configurations for secure pages, but haven't been able to fix it. */autocomplete/* is listed in the ignore pages field.
Comment #2
joeredhat-at-yahoo.com commentedI too am having problems with autocomplete with secure pages. In general, there are probably a number of requests (autocomplete, AJAX requests, etc.) that need to be made via HTTPS if the page was loaded via HTTPS, and via HTTP otherwise. Unfortunately, it appears to me that Secure Pages only says "force this to HTTPS" if it matches one list or "force this not to be HTTPS" if it matches the other list.
What would it take to add a third list of "If it matches this list, request it in the same manner as the existing page"? Is that even possible?
Comment #3
eachin commentedI'm having the exact same problem and would love to hear of a fix or work around.
Comment #4
jrogers@jrdesignsbyjoy.com commentedI am having the same problem. Please someone let us know how to fix it!! It is really annoying!
Comment #5
pnee commentedI am also having this problem and cannot resolve it. autocomplete calls get http 403 errors. If I disable Secure Pages autocomplete works correctly.
This is occurring when using autocomplete features in multiple modules, including ubercart (create coupon, select applicable products) and URL Redirect (Add redirect, "from" field).
Comment #6
nheim commentedhello,
im not sure for the HTTPS only problem but some hosts add code to output files, the jQuery ajax call can fail because this added code disturb the correct json syntax provided by drupal php scripts.
Comment #7
ben_scott commentedHi -
Getting the same error, and it was being caused by autocomplete using the $base_url for the callback. We'd set $base_url = http://...; so the callback was always for http://... even on https pages. So if you've got $base_url set you could try commenting it out.
If it's not set Drupal will build the $base_url - & for it to do that correctly on https pages, $_SERVER['HTTPS'] must be set to on. Our hosting co used a different variable, so we also needed to manually set $_SERVER['HTTPS']:
Hope that works for you too.
Cheers,
Ben
Comment #8
Nathan Goulding commentedThanks, Ben, this fixed it for me. +1.
Comment #9
Renee S commentedDitto, thanks =)
Comment #10
Renee S commentedI'm going to go ahead and close this, it seems to have been confirmed fixed and no other reports since.
Comment #11
vorbian commentedWhat about setting the $base_url to https://... ?
Comment #12
Beedge commentedSetting base_url to https:// only works if you want the whole site to be redirected to https as oppossed to mixed http/https