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

Same site backup throws errors for some sections with images

XMLWordPrintable

    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • Hide
      • Edit a section on your source course
      • Add an image
      • Save
      • Re-edit section
      • Change the image some how
      • Save
      • Open a new course
      • Import the first course in
      • Confirm that there were no errors
      • Fiddle about and try this a few times.

      Note: You may want to add a debugging call to the patch to log when a file has been restored previously to ensure that you would have hit it.

      Show
      Edit a section on your source course Add an image Save Re-edit section Change the image some how Save Open a new course Import the first course in Confirm that there were no errors Fiddle about and try this a few times. Note: You may want to add a debugging call to the patch to log when a file has been restored previously to ensure that you would have hit it.

      I'm struggling to work out how to replicate this, but I do have a fix.

      Basically, it seems that if the source course has a section with an image inline, then that image is sometimes included twice in the backup. As a result, it's inserted twice by restore_dbops.class.php and because of unique key constraints on the pathhash, an exception is thrown.

      It's easy to fix (check for the file first) but I'm struggling to write test instructions because I can't reliably replicate the issue. It seems to occur on a course if you've added a file to a section, and then later modified it.

        1. 40440.zip
          29 kB
        2. import.php
          1 kB

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Jason Fowler Jason Fowler
            Damyon Wiese Damyon Wiese
            Adrian Greeve Adrian Greeve
            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.