From: sam_marshall Date: Thu, 31 Jul 2008 10:57:41 +0000 (+0000) Subject: MDL-15498: Completion: forum was failing to backup completion rules X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=035fa24b6ad855c6475cc86c52f1c36ae528492b;p=moodle.git MDL-15498: Completion: forum was failing to backup completion rules --- diff --git a/mod/forum/backuplib.php b/mod/forum/backuplib.php index 812aebfb73..120ceab882 100644 --- a/mod/forum/backuplib.php +++ b/mod/forum/backuplib.php @@ -85,7 +85,10 @@ fwrite ($bf,full_tag("WARNAFTER",4,false,$forum->warnafter)); fwrite ($bf,full_tag("BLOCKAFTER",4,false,$forum->blockafter)); fwrite ($bf,full_tag("BLOCKPERIOD",4,false,$forum->blockperiod)); - + fwrite ($bf,full_tag("COMPLETIONDISCUSSIONS",4,false,$forum->completiondiscussions)); + fwrite ($bf,full_tag("COMPLETIONREPLIES",4,false,$forum->completionreplies)); + fwrite ($bf,full_tag("COMPLETIONPOSTS",4,false,$forum->completionposts)); + //if we've selected to backup users info, then execute backup_forum_suscriptions and //backup_forum_discussions if (backup_userdata_selected($preferences,'forum',$forum->id)) { diff --git a/mod/forum/restorelib.php b/mod/forum/restorelib.php index 300e0b1adf..94cb1a61fe 100644 --- a/mod/forum/restorelib.php +++ b/mod/forum/restorelib.php @@ -80,7 +80,9 @@ $forum->warnafter = isset($info['MOD']['#']['WARNAFTER']['0']['#'])?backup_todb($info['MOD']['#']['WARNAFTER']['0']['#']):''; $forum->blockafter = isset($info['MOD']['#']['BLOCKAFTER']['0']['#'])?backup_todb($info['MOD']['#']['BLOCKAFTER']['0']['#']):''; $forum->blockperiod = isset($info['MOD']['#']['BLOCKPERIOD']['0']['#'])?backup_todb($info['MOD']['#']['BLOCKPERIOD']['0']['#']):''; - + $forum->completiondiscussions = isset($info['MOD']['#']['COMPLETIONDISCUSSIONS']['0']['#'])?backup_todb($info['MOD']['#']['COMPLETIONDISCUSSIONS']['0']['#']):0; + $forum->completionreplies = isset($info['MOD']['#']['COMPLETIONREPLIES']['0']['#'])?backup_todb($info['MOD']['#']['COMPLETIONREPLIES']['0']['#']):0; + $forum->completionposts = isset($info['MOD']['#']['COMPLETIONPOSTS']['0']['#'])?backup_todb($info['MOD']['#']['COMPLETIONPOSTS']['0']['#']):0; //We have to recode the scale field if it's <0 (positive is a grade, not a scale) if ($forum->scale < 0) {