The $statusset array is looped over to update the status IDs using $this->get_mappingid(). However, because the loop variable $st is assigned by value instead of by reference, the newly mapped IDs are discarded and the old IDs from the backup file end up being saved to the database.
A quick fix would be to add an & to pass by reference (or just update the value via the array key):
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_501_STABLE/backup/moodle2/restore_attendance_stepslib.php#L183
The
$statussetarray is looped over to update the status IDs using$this->get_mappingid(). However, because the loop variable$stis assigned by value instead of by reference, the newly mapped IDs are discarded and the old IDs from the backup file end up being saved to the database.A quick fix would be to add an
&to pass by reference (or just update the value via the array key):https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_501_STABLE/backup/moodle2/restore_attendance_stepslib.php#L183