Affects Version/s: 3.7.7, 3.8.4, 3.9.1, 3.10.5, 3.11.1
Fix Version/s: None
Affected Branches:MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
When resetting a course and deleting all submissions of an assignment with PDF annotation enabled, we've realized that the submissions are deleted but the assignfeedback_editpdf files linked to them aren't. That leaves orphaned files on the MoodleData, and they can make storage troubles in the long term.
I don't know if the approach should be to delete them when deleting the submissions or to create a scheduled task looking for and deleting orphaned assignment feedback files.
- Create a course, enrol a student and create an assignment for file submission with PDF annotation enabled
- As a student, submit a file to the assignment (not a PDF, to force the conversion)
- As a teacher, go to the "Grade" page of the student's submission (the submission should be converted to PDF when doing it if it wasn't already converted by the scheduled task)
- Reset the course checking "Delete all submissions" on the assignment section
- As an admin, make a backup with user data and download it
- Change the extension from MBZ to ZIP and browse the content. The PDF version of the submission is correctly deleted, but in the files.xml you should find the file again
- The file itself should be inside the files folder. On this example is this: files/83/8351695938a60ce9b524ea2e53f29e168a26cf16
- I've seen on the database that on the files table most of these orphaned files have these filearea values : readonlypages, pages and combined.