dfp_external_storage icon indicating copy to clipboard operation
dfp_external_storage copied to clipboard

allow saving files with no content or local file set yet. autosave up on file upload

Open khoran opened this issue 1 year ago • 1 comments

Here is a possible fix the issue I described here.

In the hook_file_before_save function, it checks to see if a local file exists by seeing if file_url is set or not. If it's not set, and it's a new file, then it just does nothing. But this lets the file be saved without any content, allowing a name to be set. Then in the upload function, if the name is not set, it will call save. This no longer results in recursion as the hook will not call the upload function now.

I did a bit of testing, but I imagine you have more tests you can run? I know it's kind of a central component being changed. It does allow my problem test case to work though.

khoran avatar May 30 '24 18:05 khoran

just fixed a typo in the first commit of this pull request that broke things. Somehow "s3" got changed to "s4".

khoran avatar Jun 19 '24 15:06 khoran