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

Backport at least part of MDL-37780 to fix migrate_file when restoring 1.9 backups

XMLWordPrintable

    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • Hide

      Testing difficulty: easy
      Testing requirements: Moodle on a Windows server (any DB)

      1. In Moodle 1.9, prepare a course with quiz that contains questions with embedded and attached images. Make sure the images are both in the root of the course files as well as in a subfolder of the course files.
      2. Backup the course.
      3. Restore the course at a Windows server. Make sure there are no error messages and the images in the questions are restored correctly.
      Show
      Testing difficulty: easy Testing requirements: Moodle on a Windows server (any DB) In Moodle 1.9, prepare a course with quiz that contains questions with embedded and attached images. Make sure the images are both in the root of the course files as well as in a subfolder of the course files. Backup the course. Restore the course at a Windows server. Make sure there are no error messages and the images in the questions are restored correctly.

      I received several reports of failure when restoring 1.9 backups under Moodle 2.4 with questions containing images or files.
      I am able to reproduce the problem myself.
      The problem is windows specific and caused by paths containing a mixture of slashs and backslashs.
      Since MDL-33424 has been implemented in Moodle 2.3.6 and Moodle 2.4.3 files embedded into questions are no more restored as legacy files and migrate_file is called. On windows sometime an exception is thrown:
      Debug info:
      Error code: file_invalid_path
      $a contents: [tempdir]/backup/648d042d6bc9cc26bf912dc81bf94c6c/course_files\bullet-1.gif
      Stack trace:

      line 1216 of \backup\converter\moodle1\lib.php: moodle1_convert_exception thrown
      line 1309 of \backup\converter\moodle1\lib.php: call to moodle1_file_manager->migrate_file()

      to solve this problem I think that all that is necessary is to backport Petr's commit a629ad3dff36554755796c9fbb790db4a02824c4 MDL-37780 fix 1.9 restore on windows.
      If this is agreed I can prepare the git branches.
      Thanks a lot for considering this.

            mudrd8mz David Mudrák (@mudrd8mz)
            jmvedrine Jean-Michel Vedrine
            Sam Hemelryk Sam Hemelryk
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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