From: toyomoyo Date: Mon, 20 Aug 2007 06:20:53 +0000 (+0000) Subject: category grades and course grades should not be dependent on restore_userdata_selectee X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f9bb6a98d8b259e7f77909272c41e37afbdedd6c;p=moodle.git category grades and course grades should not be dependent on restore_userdata_selectee --- diff --git a/backup/backuplib.php b/backup/backuplib.php index 9ae6e10e7a..6ddfd209e4 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -1514,7 +1514,10 @@ // back up the other stuff here // mod grades should only be backed up if selected - if ($grade_item->itemtype == 'mod' && backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) { + if ($grade_item->itemtype == 'mod' && !backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) { + // do not write grades if a mod grade_item is being restored + // but userdata is not selected + } else { $status = backup_gradebook_grades_info($bf,$preferences,$grade_item->id); $status = backup_gradebook_grades_text_info($bf,$preferences,$grade_item->id); } diff --git a/backup/restorelib.php b/backup/restorelib.php index 08d583c286..565bd959c3 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1576,7 +1576,7 @@ } // no need to restore grades/grades_text if user data is not selected - if (!restore_userdata_selected($restore, $dbrec->itemmodule, $iteminstance)) { + if ($dbrec->itemtype == 'mod' && !restore_userdata_selected($restore, $dbrec->itemmodule, $iteminstance)) { // module instance not selected when restored using granular // skip this item $counteritems++;