I'm trying to fix a bug in file-storage, but whatever I try doesn't do what I want it to do.
Here's the thing. When trying to delete multiple files at once (by clicking multiple checkboxes) only one file gets deleted. This is because by an error in delete.tcl only the object_id of one file makes it into the hidden textfield on the confirmation screen.
Solving that is easy I thought, and indeed having all object_id's appear, space separated, in the hidden form field was no problem.
However, now the formfield contains e.g. "623 645" (two object_id's) and when submitted, the scripts receives "{623 645}" (this is NOT a tcl list mind you - it's a string starting with { and ending with }, that's my problem).
Of course, the dirty way would be to just strip the accolades, but I guess there's a better way.
The contract is changed to:
ad_page_contract {
delete items
} {
object_id:notnull,multiple
{confirm_p:optional,boolean 0}
{return_url ""}
}
--> object_id used to be declared integer, but that doesn't work if you need to pass multiple values via a textfield.
When called from the folder-view (when you press delete) everything goes ok - multiple object_id variables with different values are passed and everybody's happy.
However, the confirmation screen is essentially a form, with all object_id's in a hidden text field. If you return to delete.tcl from the confirmation screen I end up the "{ ... }" problem.
Thanks in advance for any help.
Rgds,
Jeroen