- Issue created by @aaron.ferris
- 🇳🇱Netherlands clivesj
Maybe I don't fully understand this, but what you are describing is the normal behavior of the Drupal File upload.
When you say:
Steps to reproduce
1. Upload files via a directory listing node
2. Don't click saveIn step-1 you are not uploading the file yet, but just *selecting* the files you want to upload.
Normally another step is needed to execute the upload. That can be by submitting a node or in case of Filebrowser, Saving the upload (Submitting the upload form)Starting with D8 we started using the Core Managed File Class to upload files in Filebrowser. That was for convenience. But other than that we don't do anything with the managed file system and corresponding Core DB tables.
FB is always intended to use the Unmanaged Filesystem. So, Drupal does not (need to) know what is happening within Filebrowser. The reason is that from the start the intention was to by-pass the Managed File System. You can upload files (outside Drupal, FTP etc) , assign a directory listing to that Directory and Filebrowser will construct the directory.
I hope this clarifies things, let me know if not or if you still require a feature.
Hi,
Agreed with OP that this is confusing and actually created an issue with a client that took me a great deal of time to debug.
Here's the issue from the client: Files uploaded in Directory Listing content type pages gets removed the following day. This happens for some pages, but not others. Client would re-upload the files, click on the save button to get the files back into those pages. However, the same files would get deleted the following day.
After much debugging, I figured out that maybe when client first uploaded the files, they forgot to click on the save button. The files would still get uploaded and displayed on the page. However, these files are recorded in the file_managed table as temporary. Because they set temporary files to be deleted every 12 hours, these files would get deleted every day despite them re-uploading them.
Since Filebrowser is completely different from Drupal's core file management system, I think this link needs to severed. This way, files aren't recorded in the file_managed table as temporary whenever the user forgets to click on the save button during file uploads. You mention that starting with D8, you guys used Drupal's Core Managed File Class for uploads. And that's probably why un-saved files are recorded as temporary in the file_managed table and don't get removed.
- 🇳🇱Netherlands clivesj
OK. I see it now and re-produced the behavior.
We need some time to figure this out because I think the solution is to move away from the core upload class or make significant changes to it to prevent this unwanted side-effect. - 🇳🇱Netherlands clivesj
I see, where the problem is.
Filebrowser cleans up the file_managed table upon form submission. But if user does not submit the form the clean-up will not happen.