Link only partially updated on course restore

Re: Link only partially updated on course restore

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moodle backup and restore is quite a complex system (because it needs to be), so it may take some patience to work out. There are docs in the dev docs, which you can find an read if you want to add context to these hints:

The cold that tells the backup system that labels contain links that need to be updated is https://github.com/moodle/moodle/blob/master/mod/label/backup/moodle2/restore_label_activity_task.class.php#L54. That looks OK. That is, what needs to have links updated is specified by methods called define_decode_contents.

Then, the code that knows how to update links to specific course sections ... well it might either be in the core backup code. Or, if the URL is specific to the course format you are using, then in may be in the course format. This is done by methods with name define_decode_rules. Looking at
https://github.com/moodle/moodle/blob/6153be6850869cdc3a6ae925dcf6e688ac481333/backup/moodle2/restore_section_task.class.php#L139
https://github.com/moodle/moodle/blob/6153be6850869cdc3a6ae925dcf6e688ac481333/backup/moodle2/restore_course_task.class.php#L146
It seems like there is no code to rewrite links to section.

I have not looked in the tracker, to see if there is already a bug report for this.
Average of ratings: Useful (1)