When selecting all files to delete (and list is empty) while editing node with swfupload widget these files are not deleting after submit.

[OR]

If there is X files and I select X-Y (Y

Best reguards
MacieQ

Comments

timlie’s picture

Version: 6.x-2.0-beta2 » 6.x-2.0-beta3

I can confirm this bug. I can reproduce the bug also in beta3.

Beside this bug thanks for this really handy module!!!

macieq’s picture

Sure, the module is handy and usefull. Please send some feedback info about the remove bug time process.

Thanx!
Mat

jcarnett’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

It looks like the problem is with swfupload_wiget_value() not properly detecting the empty state for the list of files, causing it to revert back to the default value and changing nothing. The attached patch fixes swfupload_widget_value() and also updates the toJson functions (why are there two?) to return "{}" for an empty object instead of "null". Bad things happen when swfupload_widget_value() gets a null, plus empty objects and null are not the same thing.

eugenmayer’s picture

Cant apply the patch to beta3

patching file swfupload.module
Hunk #1 succeeded at 168 (offset -2 lines).
patching file js/swfupload_widget.js
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:

did you apply any patches before?

jcarnett’s picture

StatusFileSize
new1.06 KB

I think I may have had some leftover junk from trying a different version or maybe dev. The file I thought was a duplicate wasn't supposed to be there at all. A corrected patch is attached.

skilip’s picture

Status: Needs review » Patch (to be ported)
j0e’s picture

tried #5 on beta, when I saved an image i'd uploaded using swfupload, got warning: preg_match() expects parameter 2 to be string

skilip’s picture

Status: Patch (to be ported) » Fixed

jOe, that can't be due to this patch. Can you please create a different issue for that?

j0e’s picture

Philip, i posted the issue at: http://drupal.org/node/822244

Joseph

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.