mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
implemented fix for restore problem given in bug #1589
This commit is contained in:
parent
210c6aed36
commit
61e59ace64
2 changed files with 15 additions and 15 deletions
|
@ -41,7 +41,7 @@
|
|||
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));
|
||||
|
@ -88,7 +88,7 @@
|
|||
foreach ($wiki_entries as $wik_ent) {
|
||||
//Start entry
|
||||
//Print submission contents
|
||||
if ($userinfo) {
|
||||
if ($userinfo) {
|
||||
$dumped_entries++;
|
||||
if ($dumped_entries == 1) {
|
||||
//Write start tag
|
||||
|
@ -111,8 +111,8 @@
|
|||
}
|
||||
}
|
||||
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;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
$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']['#']);
|
||||
|
@ -118,18 +118,18 @@
|
|||
//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,
|
||||
|
@ -141,8 +141,8 @@
|
|||
//Restore wiki_pages
|
||||
$status = wiki_pages_restore_mods($oldid,$newid,$ent_info,$restore);
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue