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

gradebook categories not backed up when user data not included

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.2
    • 1.9.1
    • Backup
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      reported by Tom Trueluk - 03/Jul/08 02:32 AM in MDL-15160
      Not sure why grade_categories aren't backed up when user_data is not selected. But here are the two locations in backup/backuplib.php where it needs to be fixed.

      First in function backup_gradebook_info it sets $backupall to false, as shown:

      // if no user data selected, we do not backup categories
      if (!backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) {
      $backupall = false;

      Meaning, when we get here (shortly below the above code)

      // Now backup grade_item (inside grade_category)
      if ($backupall)

      { $status = backup_gradebook_category_info($bf,$preferences); }

      Gradebook categories aren't backed up.

      And also in the function backup_gradebook_item_info, if the grade_item is of type category it isn't backed-up if $backupall is false:

      } else if ($grade_item->itemtype == 'category') {
      // if not all grade items are being backed up
      // we ignore this type of grade_item and grades associated

      if (!$backupall)

      { continue; }

      }

      I'm not sure why it's programmed this way, but removing the $backupall conditional statements in backuplib.php will fix the issue of missing categories.

      But, manual grade_items which have a calculation are not restored correctly. The new grade_item ID's aren't populated in the calculation when restored and instead the calculation string from the backup file is plugged straight into the database. The id's in the calculation string need to be adjusted to reflect the newly created ID's for the restored grade_items.

            skodak Petr Skoda
            skodak Petr Skoda
            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.