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

Reset and delete all submissions doesn't delete the assignfeedback_editpdf files

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      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.

      Replication steps:

      1. Create a course, enrol a student and create an assignment for file submission with PDF annotation enabled
      2. As a student, submit a file to the assignment (not a PDF, to force the conversion)
      3. 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)
      4. Reset the course checking "Delete all submissions" on the assignment section
      5. As an admin, make a backup with user data and download it
      6. 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
      7. The file itself should be inside the files folder. On this example is this: files/83/8351695938a60ce9b524ea2e53f29e168a26cf16
      8. I've seen on the database that on the files table most of these orphaned files have these filearea values : readonlypages, pages and combined.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            izendegi Iñigo Zendegi
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            38 Vote for this issue
            Watchers:
            31 Start watching this issue

              Dates

              Created:
              Updated: