-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.11.16, 4.0.10, 4.1.5, 4.2.2
-
MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
Maybe there is a code related cause/bug for there not being directory "." records for some files inside the user/draft filearea.
But this issue is not about that.
The task file_trash_cleanup_task looks for older "." records and then deletes all files "inside" those directories. See https://github.com/moodle/moodle/blob/cccc00954d246448556a3e97874fc2288bdf9674/lib/filestorage/file_storage.php#L2265-L2273
But if somehow there is no "." record to contain user/draft file records (i.e. something went wrong when creating the user/draft files or someone who doesn't know how the Moodle files API works deleted those)...the task should probably check for those "directory-less draft files" and remove those records, too.
Otherwise they would never get removed and any files referenced as user/draft files would never be removed from the file storage.