Issue Details (XML | Word | Printable)

Key: MDL-15509
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

gradebook categories not backed up when user data not included

Created: 03/Jul/08 06:51 AM   Updated: 03/Jul/08 06:52 AM
Return to search
Component/s: Backup
Affects Version/s: 1.9.1
Fix Version/s: 1.9.2

Issue Links:
Relates
 

Participants: Petr Skoda
Security Level: None
Resolved date: 03/Jul/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 03/Jul/08 06:51 AM
fixed in cvs