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

deleting course sections does not delete files used in description of section

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-60972-master_delete_section_files
    • Hide

      Please run all steps for each branch.

      Before upgrade

      1. Create a new instance of Moodle, but DO NOT install it.
      2. Checkout the respective weekly branch:
        • master: 38a1b4f203c706a3b374d343270ba9202cc17d93
        • 36: 7f234acc6e76f25b19dcadbe25ab1edaa23c390f
        • 35: 79d87ad6832c66af2cf24424ae4dbc8586440d03
          E.g.

          git checkout 38a1b4f203c706a3b374d343270ba9202cc17d93

      3. Run through the Moodle installation.
      4. Embed some images into some sections in the description text.
      5. Ensure that the images are stored in mdl_files table with context = [context of course], filearea = 'section', and itemid = [id of section]
      6. Delete these sections.
      7. Ensure the files are still present in the files table (they are now orphaned).
      8. Run the upgrade to the current version.
      9. Check the mdl_files table to see that the orphaned files have now been removed.

      After upgrade

      1. Now, checkout the respective head for the branch:
        e.g.

        git checkout BRANCH_NAME

      2. Run through the site upgrade.
      3. Embed an image into the sections description text.
      4. Ensure that image is stored in the mdl_files table with context = [context of course], filearea = 'section', and itemid = [id of section]
      5. Delete this section.
      6. Ensure the file is deleted from the mdl_files table.
      Show
      Please run all steps for each branch. Before upgrade Create a new instance of Moodle, but DO NOT install it. Checkout the respective weekly branch: master: 38a1b4f203c706a3b374d343270ba9202cc17d93 36: 7f234acc6e76f25b19dcadbe25ab1edaa23c390f 35: 79d87ad6832c66af2cf24424ae4dbc8586440d03 E.g. git checkout 38a1b4f203c706a3b374d343270ba9202cc17d93 Run through the Moodle installation. Embed some images into some sections in the description text. Ensure that the images are stored in mdl_files table with context = [context of course] , filearea = 'section', and itemid = [id of section] Delete these sections. Ensure the files are still present in the files table (they are now orphaned). Run the upgrade to the current version. Check the mdl_files table to see that the orphaned files have now been removed. After upgrade Now, checkout the respective head for the branch: e.g. git checkout BRANCH_NAME Run through the site upgrade. Embed an image into the sections description text. Ensure that image is stored in the mdl_files table with context = [context of course] , filearea = 'section', and itemid = [id of section] Delete this section. Ensure the file is deleted from the mdl_files table.

      If a image is embedded into the description text for a course section, the image is stored in {files} table with component = course and filearea = section. As far as i can see, this entry is not removed from {files} table, when section is deleted. 

      Steps to check:

      1. Embed an image into sections description text.
      2. Image is stored in mdl_files table with context = [context of course], fileare = "section" and itemid = [id of section]
      3. Delete this section.
      4. Check the mdl_files table, the file remains in mdl_files, it will also not been removed by cleanup tasks as long as the (course-) context is still valid (i. e. as long as the course is not deleted).

      Background: Point 4 is a problem for us, because we have developed a new plugin that searches for files to add copy right notices and this section files would be found but on the other hand not really used in moodle.

       

      Proposal: We may remove the area files instantly, when the section is removed.

       

       

            wagner139 Andreas Wagner
            wagner139 Andreas Wagner
            Adrian Greeve Adrian Greeve
            Jake Dallimore Jake Dallimore
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m

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