]> git.mjollnir.org Git - moodle.git/commitdiff
category grades and course grades should not be dependent on restore_userdata_selectee
authortoyomoyo <toyomoyo>
Mon, 20 Aug 2007 06:20:53 +0000 (06:20 +0000)
committertoyomoyo <toyomoyo>
Mon, 20 Aug 2007 06:20:53 +0000 (06:20 +0000)
backup/backuplib.php
backup/restorelib.php

index 9ae6e10e7aa61e7cd12812651bf78ab8e9da4568..6ddfd209e4f5fa9767af3fec27e8bbc1e8400a06 100644 (file)
 
                 // 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);
                 }
index 08d583c2860b46596dbc0d54ae783777cbb4dbb5..565bd959c36f15055829991ebaed4a7045c67971 100644 (file)
                             }
                             
                             // 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++;