After pressing 'Attach' in the upload form the upload hangs (progress bar keeps progressing). However the file shows up in the php_temp_upload folder and after pressing 'Submit' or 'Preview' it appears two times in the upload list.

I have this problem only in Firefox 1.0 (restart browser, clear cache won't help), in IE 6.0 it works fine.

Comments

killes@www.drop.org’s picture

I am pretty sure this is fixed in cvs. Please upgrade your site and report back.

tenrapid’s picture

Title: Upload hangs in Firefox1.0 » Upload hangs in Firefox 1.0.7
Version: 4.7.0-beta6 » x.y.z

Unfortunately not. I did a clean CVS install and the problem in Firefox 1.0.7 is still there. If I disable javascript it works fine.

killes@www.drop.org’s picture

can you do the following:

1) put these lines at the top of settings.php

ini_set("display_errors","1");
ini_set('error_reporting', E_ALL ^ E_NOTICE);
ini_set('log_errors', "1");
ini_set('track_errors', '1');

2) switch JS off and report whether you see any errors when uploading.

3) try the same with JS on.

tenrapid’s picture

There are no errors displayed.

However, the javascript console shows the following error:

Error: unterminated string literal
Source File: http://elfrapid/drupal-cvs/misc/drupal.js
Line: 319, Column: 27
Source Code:
({ "status": true, "data": "\x3cdiv id=\"fileop-wrapper\"\x3e\n\x3cdiv
tenrapid’s picture

Title: Upload hangs in Firefox 1.0.7 » Upload hangs in Firefox 1.0.7 — drupal.js issue

I just did a clean 4.7beta4 install and found that everything works fine.

The javascript error I get in CVS points to drupal.js so things that have been changed there between beta4 and CVS could have caused the error. I found that there was only one commit to drupal.js in this time (revision 1.18 to 1.19).

In this commit the 'window.iframeHandler' function that is defined in function 'redirectFormButton' has been modified. There a variable 'response' is set to the content of a hidden iframe:

response = (iframe.contentWindow || iframe.contentDocument || iframe).document.body.innerHTML;

Then 'response' is passed to parseJson() where it is evaled:

response = parseJson(response);
function parseJson(data) {
  if (data.substring(0,1) != '{') {
    return { status: 0, data: data.length ? data : 'Unspecified error' };
  }
  return eval('(' + data + ');');
}

And this is where I get the error. So I did some tests with eval.

'response' contains something like {"status": "abc", "data":"\x3cem style=\"font-weight:bold;\"\x3test\x3c/em\x3e"}

But eval('({"status": "abc", "data":"\x3cem style=\"font-weight:bold;\"\x3test\x3c/em\x3e"})'); gives me the 'missing } after property list' error.

Instead eval('({"status": "abc", "data":"\x3cem style=\\\"font-weight:bold;\\\"\x3test\x3c/em\x3e"})'); works fine.

At this point I don't know what to do next. The need for double escaping the " is quite odd. But I'm no javascript expert, so can someone help investigating this further?

tenrapid’s picture

Status: Active » Closed (fixed)

closed
the real issue is there: http://drupal.org/node/55518

Zen’s picture

Status: Closed (fixed) » Closed (duplicate)

Dupe: http://drupal.org/node/53314 . Please always try and reuse the earliest existing issue for a bug.

-K