First off, this bug seems to be in every version of this module in the 6.x branch. Not sure about 5.x.

The issue is in swfupload_widget.js line ~742:

ref.upload_stack[fid] = {filename:file.filename || file.name, fid:fid};

This line of code results in a upload_stack that has incorrect filenames inside the hidden form element that the data about the uploads is being stored.

The fix I found that seems to fix the issue is below (needs review):

         //fix for issue with filenames!	
	 if(old_upload_stack[fid]){
	        ref.upload_stack[fid] = {filename: old_upload_stack[fid].filename || old_upload_stack[fid].name, fid:fid};
		}else{
		    ref.upload_stack[fid] = {filename:file.filename || file.name, fid:fid};
	 }		
	 //end fix

On an aside note, I think this module lost functionality by not having a form element available to developers past the 1.x version. I had no other way except to use a form element for what I needed to to use this module for. Thankfully I found that version 1.x version though. Thanks a lot!

Comments

dieterlwrs’s picture

I don't really know if I should have replaced just the 1 line:
ref.upload_stack[fid] = {filename:file.filename || file.name, fid:fid};

Or the if else:

if (!file) {
        ref.upload_stack[fid] = old_upload_stack[fid];
      }
      else {
        ref.upload_stack[fid] = {filename:file.filename || file.name, fid:fid};

But I've tried both but I keep getting the error and the order doesn't save.

kenorb’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.