Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having trouble with the upload module.
"Attach new file" doesn't work in Firefox (Win 1.5.0.7) when javascipt is turned on: Just the loading bar and then nothing, no javascript error is logged. With javascript turned off it works.
Opera (Win 9.02) shows a blank javascript error alert on the first file that is added, but the file still gets added. When adding additional files there is no error.
Internet Explorer (Win 6) works without any error.
In case this can't be duplicated, feel free to remove the "critical" priority.
Comment | File | Size | Author |
---|---|---|---|
#11 | opera_upload_hack.patch.txt | 790 bytes | Heine |
#7 | opera.upload.error.png | 27.94 KB | RobRoy |
Comments
Comment #1
webernet CreditAttribution: webernet commentedCould not reproduce with Firefox 2 or 1.5.0.7.
Comment #2
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedOpera give error for first uploaded file:
An error occurred:
and nothing else. No errors on next uploads.
Can't reproduce on Firefox 2.
On IE6 (IE Tab), the file remains uploading. No response.
Comment #3
worldcoast CreditAttribution: worldcoast commentedwithout getting into end user support, it may be your Java I've run into similar problems with my company website, disabling a particular java plugin in the browser and letting it be handled outside of the browser will make it work often.
Also try upgrading to the latest version of Java if you have not already.
In firefox:
Tools>Options>Content to make sure Java is enabled.
Comment #4
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedHow's Java interrupting Javascript?
Comment #5
kkaefer CreditAttribution: kkaefer commentedI tested with both uid=1 and other users with less rights and could not reproduce the bug in Firefox 2 (Mac OS), Firefox 1.5 and 1.0.8 (Windows) and IE 6 and 7 (Windows).
Please reopen this issue only if you found the bug (if there is one) or if you know how to reproduce this bug on an arbitrary installation.
Comment #6
anders.fajerson CreditAttribution: anders.fajerson commentedIt still doesn't work on my installation of Firefox 1.5.0.8 on Win (tested in safe-mode, all extensions off). Firefox 2 works. As it couldn't be reproduced in Firefox 1.5 I instead focus this issue on the Opera bug, which was reproduced (hope that's ok):
"Opera (Win 9.02) shows a blank javascript error alert on the first file that is added, but the file still gets added. When adding additional files there is no error."
Comment #7
RobRoy CreditAttribution: RobRoy commentedI can confirm this bug in Opera. The first upload gives an undefined JS error, while subsequent uploads do not. All uploads go through fine though, just have that first error coming up.
Opera Version: 9.00
Build: 8502
System: Windows XP
Comment #8
Heine CreditAttribution: Heine commentedOpera 9 comes with an Error Console at Tools » Advanced » Error console. It's output:
Comment #9
Heine CreditAttribution: Heine commentedPlease disregard the above message. It does not occur on all errors.
Comment #10
Heine CreditAttribution: Heine commentedThe problem seems to be that drupal.js's Drupal.redirectFormButton receives an empty response (response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;) first.
Comment #11
Heine CreditAttribution: Heine commentedThis is weird. iframeHandler is actually called twice when uploading the first attachment. The first time it receives the 0 response. Even stranger, when I add an alert('msg') before grabbing the response, the proper data is received and no error occurs. I've contacted Opera ASA to see if they can shed a light on this. In the mean time, here's a hack.
Comment #12
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedThis issue is still active in 5.x.
Comment #13
robomalo CreditAttribution: robomalo commentedI can also confirm this bug.
Details:
Comment #14
dharamgollapudi CreditAttribution: dharamgollapudi commentedSubscribing to see the fix for bug in Opera on Windows........
Comment #15
dharamgollapudi CreditAttribution: dharamgollapudi commentedSubscribing to see the fix for bug in Opera on Windows........
Comment #16
dharamgollapudi CreditAttribution: dharamgollapudi commentedSubscribing to see the fix for bug in Opera on Windows........
Comment #17
dharamgollapudi CreditAttribution: dharamgollapudi commentedI just realized that the patch is posted at http://drupal.org/node/156430
Comment #18
Heine CreditAttribution: Heine commentedComment #19
Heine CreditAttribution: Heine commentedRelated and perhaps containing a fix (somwhere in the patch): http://drupal.org/node/152378
Comment #20
Heine CreditAttribution: Heine commentedLooking at http://drupal.org/node/152378:
The code here doesn't matter. Anything that generates an error eg:
Will 'fix' the undefined error alert in Opera, while uploads still work.
Comment #21
Junyor CreditAttribution: Junyor commentedOpera Software has analyzed this issue and determined that it's not a bug. Opera has a non-blocking script engine, which means that Opera starts loading immediately when the script requests it. Gecko will fire 2 load events and fail like Opera if the form submit is delayed long enough.
Comment #22
GoofyX CreditAttribution: GoofyX commentedI'm using Drupal 5.2 and I've been experiencing this issue. Opera 9.24 on Linux fails, where Firefox 2.0.0.8 succeeds and I'm getting this error message. The file seems to be uploaded, however it is not found in the files directory, although the page is refreshed and displays the file as attached.
Is there a solution for this?
Comment #23
emok CreditAttribution: emok commentedWell, for me with Opera 9.25 (on Ubuntu Linux 7.10) the patch in #17 (or #11 which is equivalent) solved it. With Firefox 2.0.0.11 it worked both before and after the patch for me.
Is it reasonable to hope for this to be applied to Drupal 5.x if we get it reviewed to ensure that it doesn't break anytning? I don't know much about the release policies.
Comment #24
ufku CreditAttribution: ufku commentedCould this(http://www.nabble.com/JQuery-Form-Plugin-returns-nothing-in-Opera-td1712...) be related?
Jquery.form plugin that is included in Drupal6 is buggy on Opera 9.2.x
Comment #25
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedThis still happens in Opera 9.51
Comment #26
NaX CreditAttribution: NaX commentedIf you look at the link from #24, they resolved the problem and malsup gives a link to a newer version of jquery.form.
In that file I found some interesting code.
I think this is related to what Heine was talking about in #10 and #11.
Comment #27
NaX CreditAttribution: NaX commentedIn Opera 9.62 and D5.11 using the Opera error console I get this :
Same error if I use Heine's hack.
It looks to me like the data might be come through wrong.
Comment #28
datacompboy CreditAttribution: datacompboy commentedI have spend lot of time yesterday, and have found core of trouble.
The core problem, is jquery.form.js when you upload, _requires_ reply to be of type text/html and wraps script/json into !
// wrap json in a textarea if the request did not come from xhr
Here is their source: http://malsup.com/jquery/form/files-raw.php
I have digged a bit more, and found, that opera and ff works fine if reply come with text/javascript, but then jquery.from.js need to be patched a bit:
now looks like
== that fix allows to upload module and ahah_helper works fine for me in opera/ff (we doesn't support IE on that project)
But to fix problem for all browsers, here two way to fix.
Fix #1: without any patches to jquery.form.js, needs to patch drupal_json function:
Fix #2: Patch jquery.from.js as above + fix drupal_json like above, but instead text/html use text/plain and remove output of tag.
Comment #29
vietcoop CreditAttribution: vietcoop commentedThis still happens in Opera 10.0
Comment #30
donquixote CreditAttribution: donquixote commentedCould it be that Opera does not like the < and > being escaped as \x3c and \x3e in drupal_to_js? For instance, PHP's json_decode() does not like it either.
See also #434394: 'HTTP error 0 occurred' on image upload
I don't know what web standards say about json syntax. Maybe the other browsers are just more tolerant?
Comment #31
donquixote CreditAttribution: donquixote commented#11 is on the right track I think.
There is some interesting info in this thread,
#434394-110: 'HTTP error 0 occurred' on image upload and further down.
Apparently there are two unrelated problems, that just have some similar symptoms:
a) problems with memory_limit on shared hosting
b) a quite obvious bug in jquery.form.js. The problem here is that the iframe onload event can fire for an empty iframe.
Comment #32
andypostsubscribe
Comment #33
datacompboy CreditAttribution: datacompboy commentedJust updated to Drupal 6.14, in opera 10 no bug with fix№1 from comment #28
Comment #34
donquixote CreditAttribution: donquixote commented@datacompboy (#33):
Can you check which flavor of this bug is solved with your fix?
#434394-157: 'HTTP error 0 occurred' on image upload
Comment #35
Alex Andrascu CreditAttribution: Alex Andrascu commentedsubscribe. same problem
Comment #36
datacompboy CreditAttribution: datacompboy commentedSorry for long delay before answer, i was out :)
Of course, since it get fixed by server-side, it fixes server-side issue. BTW, "a) With the client-side / javascript issue, you get the error message immediately after clicking "upload"." is really also server-side problem, just if you tries to upload little image or on fast connection.
Have updated drupal to 6.19. Fix in common.inc for drupal_json works like a charm.
Comment #37
dpearcefl CreditAttribution: dpearcefl commentedHas this issue been fixed in the latest D6?
Comment #38
dpearcefl CreditAttribution: dpearcefl commented