Comment 2 for bug 623648

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

My commit 37ee9438 only does the part of the job towards this bug solving. The problem is really weird and yet I have not found the reason. The bug is applicable to filebrowser element that have "select" feature enabled (blog posts, "Some HTML" block within the view) and javascript is enabled.

To replicate the bug one should do the following steps:
1. Open "My Blog" and create new post (or edit existing one).
2. Click "Add the file" button.
3. Select the file to upload, it should finish successfully.
3a. (optional) You may upload another file or select file(s) from the list of existing files below.
4. Click "Remove" near any file in attachments.
5. Try to upload another file - uploading will never finish.

In fact the sequence above is not strict to replicate the bug, the problem occurs only if you are trying to upload the file (upload_submit function in filebrowser.js) right after removing any single file (unselect function in filebrowser.js). If you upload a file after any other event (say, you may Remove one file, then Select another one, then upload), upload will finish smoothly.

Investigation showed that this is not related to callback processing , as form is simply not submitted (data does not reach php side). I think it is something related to javascript signal processing. Say, adding a submit button, that calls the same self.upload_submit as file element does (and removing this event connector from file element) will solve the problem, but we do not need an extra button, do we?

Ironically, if you apply the attached patch, and click on the "Submit helper" button at the time when uploading got stuck, uploading will finish successfully.

I have search forums for similar problems, no luck so far.

The problem occurs in both IE and FF, on both 1.3 and master.

Any ideas?