Affects Version/s: 3.2.4
Fix Version/s: None
Component/s: Files API
When a file is added as an alias in a folder module, the downloading of the folder create a zip archive with an empty text file of 0ko having the name of the original (consistent) file.
I've seen in
MDL-44066 that a similar problem happend for the restoration of a course where the SCORMs were added using an alias.
I've done a bit of research and it seams that the problem is eiter
- the use of $fs->get_file(...) in mod/folder/download_folder.php versus $fs->get_area_files(...) in mod/resource/view.php
- the function get_directory_files(...) declared in lib/filestorage/file_storage.php and called in lib/filestorage/zip_packer.php in the function archive_stored(...)
I've tried to get the right file using the mdl_files.referencefileid field (looking in the mdl_file_reference table for matching id) but I didn't see a right way to do it with the moodle file API.
I feel like the best way to fix that bug is to change the function get_directory_files() and make it return also the original content of an alias file but I am not aware of all the consequences that this modification can create.
Could you, dear moodler, explain your point of view on the proposed solutions or give another one ?
Have a nice day,