Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79138

file_trash_cleanup_task: User/Draft file records without corresponding "." directory file records do not get cleaned

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.11.16, 4.0.10, 4.1.5, 4.2.2
    • Files API
    • 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.

            Unassigned Unassigned
            poggenpohlda Daniel Poggenpohl
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.