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

Can't delete course if repository deleted before patch

    XMLWordPrintable

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      This test requires that we put the system in a particular state, which requires us to revert certain commits

      1. Create a new branch, based on integration (the branch name might be master, MOODLE_36_STABLE or MOODLE_35_STABLE depending on which version you're currently testing):

        git checkout master
        git checkout -b myrevertbranch
        

      2. Revert the commits 33e385a5fb224c3 (from MDL-37757) and the commit from this issue:
        master:

        git revert 33e385a5fb224c3
        git revert c7bd047d244985f3f7c02f1d4fc262a2219f575a -m 1
        

        36:

        git revert 33e385a5fb224c3
        git revert 8f0bd4fb15e66f6947fe705aa4d07e4f122982a0 -m 1
        

        35:

        git revert 33e385a5fb224c3
        git revert f6b4c923ec8dc0838b06d59a798fed769ba5a007 -m 1
        

      3. Create file system repository instance (site level), making sure to check "Allow relative files"
      4. Make sure you have at least one file in the directory used by the file system repository
      5. Create a file activity in a course. Pick a file from repository and tick 'Create an alias/shortcut to the file'
      6. Delete the file system repository instance via site admin
      7. Now, checkout the main branch again (this might be master, MOODLE_36_STABLE or MOODLE_35_STABLE depending on which version you're currently testing):

        git checkout master
        

      8. Run the upgrade.
      9. Visit the course, and verify you don't see any errors.
      10. Delete the course which was using the repository file and verify this completes without any errors.
      Show
      This test requires that we put the system in a particular state, which requires us to revert certain commits Create a new branch, based on integration (the branch name might be master, MOODLE_36_STABLE or MOODLE_35_STABLE depending on which version you're currently testing): git checkout master git checkout -b myrevertbranch Revert the commits 33e385a5fb224c3 (from MDL-37757 ) and the commit from this issue: master: git revert 33e385a5fb224c3 git revert c7bd047d244985f3f7c02f1d4fc262a2219f575a -m 1 36: git revert 33e385a5fb224c3 git revert 8f0bd4fb15e66f6947fe705aa4d07e4f122982a0 -m 1 35: git revert 33e385a5fb224c3 git revert f6b4c923ec8dc0838b06d59a798fed769ba5a007 -m 1 Create file system repository instance (site level), making sure to check "Allow relative files" Make sure you have at least one file in the directory used by the file system repository Create a file activity in a course. Pick a file from repository and tick 'Create an alias/shortcut to the file' Delete the file system repository instance via site admin Now, checkout the main branch again (this might be master, MOODLE_36_STABLE or MOODLE_35_STABLE depending on which version you're currently testing): git checkout master Run the upgrade. Visit the course, and verify you don't see any errors. Delete the course which was using the repository file and verify this completes without any errors.
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
      MDL-63710-MOODLE_35
    • Pull 3.6 Branch:
      MDL-63710-MOODLE_36
    • Pull Master Branch:
      MDL-63710-master

      Description

      There was a patch https://tracker.moodle.org/browse/MDL-37757 which fixed the issue when repository is deleted. But it only works if repository was deleted after applying a patch. We have client that wants to delete course, but not able because repository was deleted (getting invalid repository ID). And patch can't fix that issue.

      So ti sum up. There is a patch at https://tracker.moodle.org/browse/MDL-37757

      This workflow is fine:

      1. Create course with some files using repository
      2. Apply patch
      3. Disable repository
      4. Delete a course

      This workflow is failing:

      1. Create course with some files using repository
        2. Disable repository
        3. Apply patch
        4. Delete a course

       

      Testing instruction: 

      1. revert patch https://tracker.moodle.org/browse/MDL-37757
      2. create file system repository, check Allow relative files
      3. Create a file activity in a course. Pick a file from repository and tick 'Create an alias/shortcut to the file'
      4. Delete repository
      5. Reapply patch https://tracker.moodle.org/browse/MDL-37757
      6. Delete a course using file above

       

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jan/19

                Time Tracking

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