MDL-11507, MDL-15157 database activity - avoid some notices on restore

This commit is contained in:
Eloy Lafuente
2009-12-18 17:51:27 +00:00
parent 06cc4c9699
commit 9e845f9ee7
+7 -3
View File
@@ -230,7 +230,11 @@ function data_records_restore_mods ($old_data_id, $new_data_id, $info, $restore)
$status = true;
$records = $info['MOD']['#']['RECORDS']['0']['#']['RECORD'];
$records = isset($info['MOD']['#']['RECORDS']['0']['#']['RECORD']) ? $info['MOD']['#']['RECORDS']['0']['#']['RECORD'] : array();
if (empty($records)) { // no records to restore
return true;
}
for ($i = 0; $i < sizeof($records); $i++) {
@@ -390,7 +394,7 @@ function data_ratings_restore_mods ($oldid, $newid, $info, $rec_info) {
$status = true;
$ratings= $rec_info['#']['RATINGS']['0']['#']['RATING'];
$ratings= isset($rec_info['#']['RATINGS']['0']['#']['RATING']) ? $rec_info['#']['RATINGS']['0']['#']['RATING'] : array();
if (empty($ratings)) { // no ratings to restore
return true;
@@ -416,7 +420,7 @@ function data_comments_restore_mods ($oldid, $newid, $info, $rec_info) {
$status = true;
$comments= $rec_info['#']['COMMENTS']['0']['#']['COMMENT'];
$comments= isset($rec_info['#']['COMMENTS']['0']['#']['COMMENT']) ? $rec_info['#']['COMMENTS']['0']['#']['COMMENT'] : array();
if (empty($comments)) { // no comments to restore
return true;