Skip to content

Commit

Permalink
MDL-23109 backup - exclude info in moodle_backup.xml about non-includ…
Browse files Browse the repository at this point in the history
…ed task. Thanks SamH!
  • Loading branch information
stronk7 committed Jul 22, 2010
1 parent 71aa947 commit fbd7413
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions backup/moodle2/restore_plan_builder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ static protected function build_course_plan($controller, $courseid) {
$task = restore_factory::get_restore_course_task($info->course, $courseid);
$plan->add_task($task);

// For the given course, add as many section tasks as necessary
foreach ($info->sections as $sectionid => $section) {
self::build_section_plan($controller, $sectionid);
}

// For the given course path, add as many block tasks as necessary
// TODO: Add blocks, we need to introspect xml here
$blocks = backup_general_helper::get_blocks_from_path($task->get_taskbasepath());
Expand All @@ -178,5 +173,10 @@ static protected function build_course_plan($controller, $courseid) {
// TODO: Debug information about block not supported
}
}

// For the given course, add as many section tasks as necessary
foreach ($info->sections as $sectionid => $section) {
self::build_section_plan($controller, $sectionid);
}
}
}
16 changes: 10 additions & 6 deletions backup/util/dbops/backup_controller_dbops.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,19 @@ public static function get_moodle_backup_information($backupid) {

if ($task instanceof backup_activity_task) { // Activity task

list($contentinfo, $settings) = self::get_activity_backup_information($task);
$contentsinfo['activities'][] = $contentinfo;
$settingsinfo = array_merge($settingsinfo, $settings);
if ($task->get_setting_value('included')) { // Only return info about included activities
list($contentinfo, $settings) = self::get_activity_backup_information($task);
$contentsinfo['activities'][] = $contentinfo;
$settingsinfo = array_merge($settingsinfo, $settings);
}

} else if ($task instanceof backup_section_task) { // Section task

list($contentinfo, $settings) = self::get_section_backup_information($task);
$contentsinfo['sections'][] = $contentinfo;
$settingsinfo = array_merge($settingsinfo, $settings);
if ($task->get_setting_value('included')) { // Only return info about included sections
list($contentinfo, $settings) = self::get_section_backup_information($task);
$contentsinfo['sections'][] = $contentinfo;
$settingsinfo = array_merge($settingsinfo, $settings);
}

} else if ($task instanceof backup_course_task) { // Course task

Expand Down

0 comments on commit fbd7413

Please sign in to comment.