From 96e76b62915bf3eac51d4cd5a2053cfbadaadb69 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 27 Jan 2005 19:43:42 +0000 Subject: [PATCH] Two missing parameters added --- backup/restore_execute.html | 4 ++-- backup/restorelib.php | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backup/restore_execute.html b/backup/restore_execute.html index d3b844d8c7..0ba822003b 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -123,8 +123,8 @@ //If we are deleting and bringing into a course or making a new course, same situation if($restore->restoreto == 0 || $restore->restoreto == 2) { echo '
  • '.get_string('creatingblocks'); - if (!$status = restore_create_blocks($restore, $xml_file)) { - notify("Error while creating the course blocks"); + if (!$status = restore_create_blocks($restore, $info->backup_block_format, $course_header->blockinfo, $xml_file)) { + notify('Error while creating the course blocks'); } } } diff --git a/backup/restorelib.php b/backup/restorelib.php index f107ac6319..73bdc62669 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -593,12 +593,12 @@ delete_records('block_instance', 'pageid', $restore->course_id, 'pagetype', MOODLE_PAGE_COURSE); if (empty($backup_block_format)) { // This is a backup from Moodle < 1.5 if (empty($blockinfo)) { - echo " from pre 1.3"; //debug + echo ' (pre 1.3)'; //debug // Looks like it's from Moodle < 1.3. Let's give the course default blocks... $newpage = page_create_object(MOODLE_PAGE_COURSE, $restore->course_id); blocks_repopulate_page($newpage); } else { - echo " from 1.3-1.4"; //debug + echo ' (1.3-1.4)'; //debug // We just have a blockinfo field, this is a legacy 1.4 or 1.3 backup $blockrecords = get_records_select('block', '', '', 'name, id'); $temp_blocks_l = array(); @@ -632,11 +632,9 @@ } } } - } else if($info->backup_block_format == 'instances') { - echo " from 1.5"; //debug - if(!$status = restore_create_block_instances($restore,$xml_file)) { - $status = false; - } + } else if($backup_block_format == 'instances') { + echo ' (1.5)'; //debug + $status = restore_create_block_instances($restore,$xml_file); } return $status; -- 2.39.5