I am trying out this module for the first time. It looks to be what I need, so I am happy to see that it exists. Thanks for putting it together!

I have a question regarding the documentation in the readme file. It says this:

If you handle this yourself, make sure that you check the property submit_action to see if the object has been flagged as deleted.

I don't get it. What will the submit_action be if it has been deleted? How would it be deleted? Can you give me a little more background to this? Thank you very much.

Comments

jaypan’s picture

Just to add, I am still curious as to the answer to my question, but I have managed to get this module working and properly saving everything to where I want it to save. Thanks! I've played with AHAH file uploads for hours, and have not been able to get it to work properly. I really need an AHAH file system for a module I am creating right now for a client, so this module is a lifesaver. Arigato!

alan d.’s picture

The cut and paste from the example will handle this by itself, the save line. The only reason for rewriting a new function would be to handle some additional special functionality into the save action, say to clean up or rename the file name, see #368002: Prefixing filename with {user}.uid: A dynamic renaming example for an example.

The submit actions are internal to the FormAPI element to flag one of new, replaced, deleted, etc.

Make sure that you use a save function, otherwise the files will not be updated from temperory and will be deleted when the cron.php is next run!!!

jaypan’s picture

Thanks for your reply. So just to confirm, upload_element_save() will take care of checking that the status is set to the correct value?

alan d.’s picture

yes :)

jaypan’s picture

Thanks mate! I'm liking the module. Marking this as closed.

jaypan’s picture

Status: Active » Closed (fixed)