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

book restore from moodle 1.9: Images are not imported

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1, 2.4.4, 2.5.3, 2.6
    • 2.4.8, 2.5.4, 2.6.1
    • Book
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MDL-35032-master
    • 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
    • 8
    • 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

            fred Frédéric Massart
            schuhmann Martin Schuhmann
            Damyon Wiese Damyon Wiese
            Sam Hemelryk Sam Hemelryk
            Sam Hemelryk Sam Hemelryk
            David Jones, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              13/Jan/14