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

File is overwritten during restore if there are shortcuts to it

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.7, 2.4.4, 2.5, 2.6.4, 2.7.1
    • Fix Version/s: BACKEND
    • Component/s: Backup, Files API
    • Labels:
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE

      Description

      Enable course legacy files site-wide and for new courses, prepare two versions of file.jpg with the same name (let's call them v1 and v2)

      Scenario 1:

      1. Create empty course
      2. Add file.jpg (v1) to course legacy files
      3. Perform backup
      4. Replace file.jpg in course legacy files with v2
      5. Perform restore selecting "merge into current course"

      If you look at course legacy files you will see v2 there - file WAS NOT replaced during restore

      Scenario 2 (almost the same except item [new]):

      1. Create empty course
      2. Add file.jpg (v1) to course legacy files
      3. [new] Create any module (for example 'File') and add there the file file.jpg as a shortcut
      4. Perform backup
      5. Replace file.jpg in course legacy files with v2
      6. Perform restore selecting "merge into current course"

      If you look at course legacy files you will see v1 there - file WAS replaced during restore.
      Also there are two modules in course now, the first shows version v2 and the second shows v1. In reality they both are shortcuts to the same file (which is now v1) and the existing shortcut was not synchronised.

      I suppose the same will happen if source file was added to course summary or course summary files and maybe even to other modules.
      It seems that more correct behaviour is when file is never overwritten during "restore with merging"

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                marina Marina Glancy
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias, Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: