mod_data is used as a highly customizable activity. Courses and presets are widely shared between users.
To hide some of the parts that might confuse from the students, trainers often set direct links to pages that allow to add an entry or something similar.
If you do a course backup, these links do not completely get processed by the backup to link to the new id of the database or entry. This leads to an unnecessary manual workload for the trainers.
Steps to reproduce:
- Create a course and a database activity.
- Choose "Image gallery preset" (this is just to speed up the test, behavior is the same for every database).
- Go to the "New entry" page and copy the url up to the part "?d=.." ("https://.../mod/data/edit.php?d=1")
- Add a label including a link to that page.
- Do a course backup including at least the database and the label.
- Restore the backup to a new course (this also happens if you restore to an existing course).
- Click the link in the label. It will point to the database activity in the "old" course instead of the new one.
The link should be processed by backup/restore to point to the restored database activity (as other links, e.g. to view.php do).
Add new rules to backup / restore in mod_data to match at least the most widely used functions.