Turn off fileupload delete

rackem

Well-Known Member
Is there a way to turn off the option to delete an uploaded file in form view?

I basically have an events list here (http://www.mypoolstats.com/tournaments/regular). Many events have flyers attached. Some of those flyers have multiple events on them so I turned on the list copy plugin to allow users to create multiple events pointed to the same flyer without having to re-upload it every time. The problem I'm running into is that someone deletes the flyer and then it affect all the other events pointed to it.

Or perhaps there is a better way to do what I am trying to accomplish?
 
Do you still want the ability for them to be able to upload a new flyer in the copies, which would change all the others?

-- hugh
 
That would be nice but I'm not sure how it would work. I assumed once a copy was made it was it's own record, un-linked to the original, other than happening to point to the same file path. So, in the event I needed to upload a replacement flyer that several events were pointed to, I assumed I would need to manually update the path at the database level as I didn't see a way to select a file from the site folder.
 
No, copies of lists/forms use the same underlying database. A given rowid is the same database row of data for every copy. So if someone uploads a new file on a copy of the list, it'll update the same row of the same table every copy is using.

Which is why I asked if you want people to change the flyer by uploading a new one on a copy. If you don't need / want that, just make the upload element read-only (using ACL's) for the copies, which (I think) should get rid of the delete button as well.

However, we do need to add a "Show Delete Button" option at some point.

-- hugh
 
Oh, I think we are talking about two different things. I just have one list. But it has the copy plugin so users can copy rows.

What would it be to add a "Show/Hide Delete Button"?
 
Oh, right. Hmmm, never really thought about that.

What would it be to add a "Show/Hide Delete Button"?

I dunno, prolly about an hour or so. Fair amount of fiddly changes. Not difficult, just time consuming.

-- hugh
 
On the copy row thing ... we do actually have an onCopyRow() method in the element model, which individual plugins can implement. For instance the date element uses it, to update the date if 'always return today's date' is set, and the user element uses it to see if 'update on edit' is set, to change the userid if necessary.

And there's a pretty good case that the upload element should implement it as well, to copy the file so your scenario doesn't happen. Being an "upload" element, the built in assumption is that every row will have a different file, and we already provide an option ("If file exists") to tell us what to do if a filename already exists when uploading (leave original, add an incrementing numeric suffix to the name, overwrite original) ... so I think the sensible thing to do would be to apply that option to row copying.

Just thinking out loud.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top