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

Backing up a course containing a wiki with linked files fails to restore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 2.3, 2.5.5, 2.6.2, 2.7
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: Wiki (2.x)
    • Labels:
    • Testing Instructions:
      Hide

      Unfortunately this does not fix restoring from backups created before the patch because files were not included at all.

      1. Create course with wiki activity, create page with files in it
      2. Backup wiki activity
      3. Restore wiki activity in another course, make sure files are restored
      Show
      Unfortunately this does not fix restoring from backups created before the patch because files were not included at all. Create course with wiki activity, create page with files in it Backup wiki activity Restore wiki activity in another course, make sure files are restored
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      wip-MDL-35305-master

      Description

      When I try to restore a course containing a wiki with a linked file, the text of the wiki is right and the link is there, but the file at the end of the link is missing.

      Steps:
      1. Create a new course with a wiki
      2. Create a wiki page with some text and a link to a file
      3. Backup the course (including user data and user files)
      4. Restoring the backup file into a new course
      5. Access the wiki and press the link on the wiki page

      Editing the backup file I noticed that the linked files are not even included, so I tried debugging it.
      Editing backup_wiki_stepslib.php I found that changing the line

      $page->annotate_files('mod_wiki', 'attachments', 'id'); // This file area hasn't itemid

      to

      $page->annotate_files('mod_wiki', 'attachments', null'); // This file area hasn't itemid

      will get the linked files included into the backup file, but the restore process still doesn't work.
      I am not sure how to debug this further, so I need some help resolving this issue.

      Br. Peter

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            pbne04 Peter Nejsum
            Peer reviewer:
            Marina Glancy
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Frédéric Massart
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            10 Vote for this issue
            Watchers:
            12 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/May/14