From b25d9087eccd668dde18f27e879f5e330a285871 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 7 Nov 2007 01:11:41 +0000 Subject: [PATCH] backup/restore of grade histories should be off by default --- backup/backup_form.html | 2 +- backup/restore_form.html | 2 +- backup/restorelib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backup/backup_form.html b/backup/backup_form.html index fd484368dc421..47357f2860f49 100644 --- a/backup/backup_form.html +++ b/backup/backup_form.html @@ -65,7 +65,7 @@ $backup_user_files = optional_param('backup_user_files',1); $backup_course_files = optional_param('backup_course_files',1); $backup_site_files = optional_param('backup_site_files',1); - $backup_gradebook_history = optional_param('backup_gradebook_history', 1, PARAM_INT); + $backup_gradebook_history = optional_param('backup_gradebook_history', 0, PARAM_INT); $backup_messages = optional_param('backup_messages',1); if ($count == 0) { diff --git a/backup/restore_form.html b/backup/restore_form.html index 44ed7bf3d0ae9..e5d85e83e9e5a 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -12,7 +12,7 @@ error( 'course_header object missing from session' ); } - $restore_gradebook_history = optional_param('restore_gradebook_history', 1, PARAM_INT); + $restore_gradebook_history = optional_param('restore_gradebook_history', 0, PARAM_INT); //Check that we have all we need //backup_unique_code diff --git a/backup/restorelib.php b/backup/restorelib.php index 45d0f70106fd3..7b69462faa80b 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1549,7 +1549,7 @@ function restore_create_gradebook($restore,$xml_file) { $dbrec->categoryid = $coursecat->id; } else if (!empty($info['GRADE_ITEM']['#']['CATEGORYID']['0']['#']) && $info['GRADE_ITEM']['#']['CATEGORYID']['0']['#']!='$@NULL@$') { $category = backup_getid($restore->backup_unique_code,'grade_categories',backup_todb($info['GRADE_ITEM']['#']['CATEGORYID']['0']['#'])); - if ($category->new_id) { + if (!empty($category->new_id)) { $dbrec->categoryid = $category->new_id; } else { // this could be restoring into existing course, and grade item points to the old course grade item (category)