Skip to content

Commit

Permalink
implemented fix for restore problem given in bug #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Jan 15, 2005
1 parent 210c6ae commit 61e59ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions mod/wiki/backuplib.php
Expand Up @@ -41,7 +41,7 @@ function wiki_backup_mods($bf,$preferences) {
fwrite ($bf,full_tag("PAGENAME",4,false,$wiki->wtype));
fwrite ($bf,full_tag("WTYPE",4,false,$wiki->wtype));
fwrite ($bf,full_tag("EWIKIPRINTTITLE",4,false,$wiki->ewikiprinttitle));
fwrite ($bf,full_tag("HTMLMODE",4,false,$wiki->allowsafehtml));
fwrite ($bf,full_tag("HTMLMODE",4,false,$wiki->htmlmode));
fwrite ($bf,full_tag("EWIKIACCEPTBINARY",4,false,$wiki->ewikiacceptbinary));
fwrite ($bf,full_tag("INITIALCONTENT",4,false,$wiki->initialcontent));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$wiki->timemodified));
Expand Down Expand Up @@ -88,7 +88,7 @@ function backup_wiki_entries ($bf,$preferences,$wiki, $userinfo) {
foreach ($wiki_entries as $wik_ent) {
//Start entry
//Print submission contents
if ($userinfo) {
if ($userinfo) {
$dumped_entries++;
if ($dumped_entries == 1) {
//Write start tag
Expand All @@ -111,8 +111,8 @@ function backup_wiki_entries ($bf,$preferences,$wiki, $userinfo) {
}
}
if ( $dumped_entries > 0 ) {
//Write end tag
$status =fwrite ($bf,end_tag("ENTRIES",4,true));
//Write end tag
$status =fwrite ($bf,end_tag("ENTRIES",4,true));
}
}
return $status;
Expand Down
22 changes: 11 additions & 11 deletions mod/wiki/restorelib.php
Expand Up @@ -45,7 +45,7 @@ function wiki_restore_mods($mod,$restore) {
$wiki->pagename = backup_todb($info['MOD']['#']['PAGENAME']['0']['#']);
$wiki->wtype = backup_todb($info['MOD']['#']['WTYPE']['0']['#']);
$wiki->ewikiprinttitle = backup_todb($info['MOD']['#']['EWIKIPRINTTITLE']['0']['#']);
$wiki->ewikiallowsafehtml = backup_todb($info['MOD']['#']['HTMLMODE']['0']['#']);
$wiki->htmlmode = backup_todb($info['MOD']['#']['HTMLMODE']['0']['#']);
$wiki->ewikiacceptbinary = backup_todb($info['MOD']['#']['EWIKIACCEPTBINARY']['0']['#']);
$wiki->initialcontent = backup_todb($info['MOD']['#']['INITIALCONTENT']['0']['#']);
$wiki->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']);
Expand Down Expand Up @@ -118,18 +118,18 @@ function wiki_entries_restore_mods($old_wiki_id,$new_wiki_id,$info,$restore) {
//If userinfo was selected, restore the entry
if ($restore->mods['wiki']->userinfo) {
//The structure is equal to the db, so insert the wiki_entries
$newid = insert_record ("wiki_entries",$entry);
$newid = insert_record ("wiki_entries",$entry);

//Do some output
if (($i+1) % 50 == 0) {
echo ".";
if (($i+1) % 1000 == 0) {
//Do some output
if (($i+1) % 50 == 0) {
echo ".";
if (($i+1) % 1000 == 0) {
echo "<br />";
}
backup_flush(300);
}
backup_flush(300);
}
if ($newid) {
//We have the newid, update backup_ids
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"wiki_entries",$oldid,$newid);
//Get old wiki id from backup_ids
$rec = get_record("backup_ids","backup_code",$restore->backup_unique_code,
Expand All @@ -141,8 +141,8 @@ function wiki_entries_restore_mods($old_wiki_id,$new_wiki_id,$info,$restore) {
//Restore wiki_pages
$status = wiki_pages_restore_mods($oldid,$newid,$ent_info,$restore);
} else {
$status = false;
}
$status = false;
}
}
}
return $status;
Expand Down

0 comments on commit 61e59ac

Please sign in to comment.