Moodle
  1. Moodle
  2. MDL-26721

Typo in setting in backup_cron_helper.class.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1.1, 2.2
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Backup
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. Navigate to Admin > Courses > Backups > Automated backup setup
      2. Configure the backup to in the near future
      3. Select 'users' to include users in the backup
      4. Unselect the 'include role assignments button'
      5. Force cron to run and ensure an automated backup has been completed
      6. Go to a course and attempt to restore a backup

      Expected result:
      -------------------------
      The users are included in the backup, and the role assignments are not

      Actual result:
      ------------------
      The users are included in the backup with the role assignments. The users
      setting is what is actually used to determine whether role assignments get
      backed up

      Show
      1. Navigate to Admin > Courses > Backups > Automated backup setup 2. Configure the backup to in the near future 3. Select 'users' to include users in the backup 4. Unselect the 'include role assignments button' 5. Force cron to run and ensure an automated backup has been completed 6. Go to a course and attempt to restore a backup Expected result: ------------------------- The users are included in the backup, and the role assignments are not Actual result: ------------------ The users are included in the backup with the role assignments. The users setting is what is actually used to determine whether role assignments get backed up
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:

      Description

      In the backup/util/helper/backup_cron_helper.class.php file at around line 312, this is written:

      'users' => 'backup_auto_users',
      'role_assignments' => 'backup_auto_users',
      'user_files' => 'backup_auto_user_files',

      The 'role_assignments' key should probably have the value 'backup_auto_role_assignments'.

        Gliffy Diagrams

          Activity

          Hide
          Sagie Maoz added a comment -

          Attaching patch (trivial change).

          Show
          Sagie Maoz added a comment - Attaching patch (trivial change).
          Hide
          Dan Poltawski added a comment -

          UPDATE m21_backup_courses set nextstarttime =0; is helpful for testing this issue

          Show
          Dan Poltawski added a comment - UPDATE m21_backup_courses set nextstarttime =0; is helpful for testing this issue
          Hide
          Dan Poltawski added a comment -

          Thanks for reporting this - i've tested and verified this issue.

          Integrators: this patch can be cherry picked onto 20_STABLE and master.

          Show
          Dan Poltawski added a comment - Thanks for reporting this - i've tested and verified this issue. Integrators: this patch can be cherry picked onto 20_STABLE and master.
          Hide
          Sam Hemelryk added a comment -

          Thanks guys, I've cherry-picked this only 20, 21, and master as there was a typo in the commit message with the MDL bug number.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks guys, I've cherry-picked this only 20, 21, and master as there was a typo in the commit message with the MDL bug number. Cheers Sam
          Hide
          Aparup Banerjee added a comment -

          yup this worked for me. course context role assignments were not restored (or even backed up). works for me!

          ps: context level role assignments obviously showed up but that shouldn't be related to the backup.

          Show
          Aparup Banerjee added a comment - yup this worked for me. course context role assignments were not restored (or even backed up). works for me! ps: context level role assignments obviously showed up but that shouldn't be related to the backup.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Sent upstream and closing, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Sent upstream and closing, many thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: