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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7, 1.8
    • Fix Version/s: 1.7.3, 1.8.3, 1.9
    • Component/s: Backup, Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      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.

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            jfilip Justin Filip
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Oct/07