Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7, 1.8
-
None
-
MOODLE_17_STABLE, MOODLE_18_STABLE
-
MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Description
When restoring a course from a backup, the API call role_assign() (/lib/accesslib.php) is called from the restore_write_roleassignments() (/backup/restorelib.php) function. The problem here is that the 'timemodified' field is always set to the current time. This means that you will never know how long students have been enrolled in a course for as their erolment (role assignment) timestamp is always the time that the restore was executed.
If a new argument to the role_assign() function is added (something like ", $timemodified = 0") this value can be overridden when restoring a backup, otherwise the default action (taking the value from PHP's time() function) can be performed.