Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-22414 META: Restore 1.9 backups into Moodle 2.1 (phase 1)
  3. MDL-27718

Migrate files into correct filearea during the conversion

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Backup
    • Labels:
      None
    • Testing Instructions:
      Hide
      • Use a 1.9 backup file that contains images embedded in HTML editor fields and some course files are referenced (linked) from these fields, too. Course description, section summaries and module intro fields should all be supported.
      • Restore the backup in Moodle 2.1 or higher
      • TEST A: make sure that images are displayed and links to files work
      • TEST B: using either Firebug or similar extension, or by looking at the images properties and links URL, make sure that the files are linked via pluginfile.php and not file.php
      Show
      Use a 1.9 backup file that contains images embedded in HTML editor fields and some course files are referenced (linked) from these fields, too. Course description, section summaries and module intro fields should all be supported. Restore the backup in Moodle 2.1 or higher TEST A: make sure that images are displayed and links to files work TEST B: using either Firebug or similar extension, or by looking at the images properties and links URL, make sure that the files are linked via pluginfile.php and not file.php
    • Workaround:
      Hide

      Thanks to the the legacy course files area, the images are actually displayed. But if the restored course or its part is backed-up again, such files are not included (or are they? I do not know to be honest. Anyway, course files must die).

      Show
      Thanks to the the legacy course files area, the images are actually displayed. But if the restored course or its part is backed-up again, such files are not included (or are they? I do not know to be honest. Anyway, course files must die).
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE

      Description

      By default the legacy course files area is used for the files referenced from a HTML content (like images in the summary/intro fields). All references using $@FILEPHP@$ in moodle.xml will link to the legacy file.php after the restore. During the conversion, we should migrate the files into proper file areas if possible. This involves:

      • rewrite $@FILEPHP@$ with @@PLUGINFILE@@
      • migrate the referenced files so they appear in files.xml
      • write filerefs into inforef.xml

      See recently added helper method moodle1_converter::migrate_referenced_files() and its usage.

      This was already fixed in the course summary field, section summary fields and intro fields in all resource successors. The questions have the attached image converted, too.

      What must be done now is to add the conversion for intro fields in all other activity modules.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Jul/11