-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
2.5
At present, file-less backups will try to restore a deleted file only if the file record still exists in the file table.
However, many of us run in such a way that the trash directory is never emptied. In this case, the trash directory remains while the entries in the file table are removed.
It would be great if we could restore from the trash directory and use the metadata in the backup.
This may require some API changes to file_storage as:
- it would be bad (and wrong) to calculate the trash path outside of file_storage
- it would be bad to call file_storage::trash_path_from_hash() outside of file_storage because the underlying file system may change to a non-filesystem store
- file_storage::try_content_recovery($file) takes a file record assuming it already exists in the database
We need a function like create_file_from_pathname() which restores the file instead.