Affects Version/s: 2.2.1, 2.3, 2.5.5, 2.6.2, 2.7
Component/s: Wiki (2.x)
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 from Repository:
Pull Master Branch:wip-
Pull Master Diff URL:
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.
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
$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.