Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10461

Restoring a course with users will not preserve the time their roles were assigned

XMLWordPrintable

    • MOODLE_17_STABLE, MOODLE_18_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

      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.

            lazyfish Yu Zhang
            jfilip Justin Filip (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.