Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

khoran
Copy link

@khoran khoran commented May 30, 2024

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
Copy link
Author

khoran commented Jun 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant