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
Comment #1
dieterlwrs commentedI 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:
But I've tried both but I keep getting the error and the order doesn't save.
Comment #2
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.