MDL-55605 mod_lesson: Fix activitylinks restore bug