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

book restore from moodle 1.9: Images are not imported

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.4.4, 2.5.3, 2.6
    • Fix Version/s: 2.4.8, 2.5.4, 2.6.1
    • Component/s: Book
    • Labels:
    • Testing Instructions:
      Hide

      Pre-requisites

      1. Create a book on a 1.9 instance
        • Add some chapters/subchaters with some files
        • Create a backup of that book

      Test

      1. Create a new course without enabling the legacy files
      2. Restore the backup from 1.9
      3. If the legacy files have been enabled after the restore, disable them again
      4. View the book
        • Make sure the images have been restored
      Show
      Pre-requisites Create a book on a 1.9 instance Add some chapters/subchaters with some files Create a backup of that book Test Create a new course without enabling the legacy files Restore the backup from 1.9 If the legacy files have been enabled after the restore, disable them again View the book Make sure the images have been restored
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-35032-master
    • Story Points:
      8
    • Sprint:
      FRONTEND Sprint 7

      Description

      A linked or embedded image from the course_files in Moodle 1.9 is not converted when restoring a 1.9 backup in moodle 2.3.

      Reason: https://github.com/moodle/moodle/blob/master/mod/book/backup/moodle1/lib.php

      The moodle2-xml file is written before the images are migrated and so the @FILEPHP@ Links are not replaced by the @@PLUGINFILE@@ Links. $this->write_xml('chapter', $data, array('/chapter/id')); should be executed at the end.

      public function process_book_chapters($data) {
          $this->write_xml('chapter', $data, array('/chapter/id'));
       
          // convert chapter files
          $this->fileman->filearea = 'chapter';
          $this->fileman->itemid   = $data['id'];
          $data['content'] = moodle1_converter::migrate_referenced_files($data['content'], $this->fileman);
      }

        Attachments

          Activity

            People

            Assignee:
            fred Frédéric Massart
            Reporter:
            schuhmann Martin Schuhmann
            Peer reviewer:
            Damyon Wiese
            Integrator:
            Sam Hemelryk
            Tester:
            Sam Hemelryk
            Participants:
            Component watchers:
            David Jones, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/14