Permalink
Browse files

fixing a bug related to setting the granular flag in restore

  • Loading branch information...
toyomoyo
toyomoyo committed Jun 13, 2007
1 parent 8eede3f commit bfd12c4dd59fbdf4dd99698a4f81741dc1abe717
Showing with 12 additions and 8 deletions.
  1. +12 −8 backup/restorelib.php
View
@@ -935,14 +935,18 @@ function restore_create_sections(&$restore, $xml_file) {
// Yu: This part is called repeatedly for every instance,
// so it is necessary to set the granular flag and check isset()
// when the first instance of this type of mod is processed.
- if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
- // This defines whether we want to restore specific
- // instances of the modules (granular restore), or
- // whether we don't care and just want to restore
- // all module instances (non-granular).
- $restore->mods[$mod->type]->granular = true;
- } else {
- $restore->mods[$mod->type]->granular = false;
+ //if (!isset($restore->mods[$mod->type]->granular) && isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
+
+ if (!isset($restore->mods[$mod->type]->granular)) {
+ if (isset($restore->mods[$mod->type]->instances) && is_array($restore->mods[$mod->type]->instances)) {
+ // This defines whether we want to restore specific
+ // instances of the modules (granular restore), or
+ // whether we don't care and just want to restore
+ // all module instances (non-granular).
+ $restore->mods[$mod->type]->granular = true;
+ } else {
+ $restore->mods[$mod->type]->granular = false;
+ }
}
//Check if we've to restore this module (and instance)

0 comments on commit bfd12c4

Please sign in to comment.