Project: moodle
Issue MDL-35032: book restore from moodle 1.9: Images are not imported
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. {code} 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); } {code}
Story points: 8