From 93d7d97fc879492e2ce967d1ee2e30598e8fc26b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Mon, 18 Aug 2003 00:03:40 +0000 Subject: [PATCH] Scales are now supported in forums backup and restore --- mod/forum/backuplib.php | 1 + mod/forum/restorelib.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mod/forum/backuplib.php b/mod/forum/backuplib.php index f41a981624..6975fff10e 100644 --- a/mod/forum/backuplib.php +++ b/mod/forum/backuplib.php @@ -51,6 +51,7 @@ fwrite ($bf,full_tag("INTRO",4,false,$forum->intro)); fwrite ($bf,full_tag("OPEN",4,false,$forum->open)); fwrite ($bf,full_tag("ASSESSED",4,false,$forum->assessed)); + fwrite ($bf,full_tag("SCALE",4,false,$forum->scale)); fwrite ($bf,full_tag("FORCESUBSCRIBE",4,false,$forum->forcesubscribe)); fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$forum->timemodified)); diff --git a/mod/forum/restorelib.php b/mod/forum/restorelib.php index 8b06931b2e..6be7ecd17d 100644 --- a/mod/forum/restorelib.php +++ b/mod/forum/restorelib.php @@ -54,9 +54,16 @@ $forum->intro = backup_todb($info['MOD']['#']['INTRO']['0']['#']); $forum->open = backup_todb($info['MOD']['#']['OPEN']['0']['#']); $forum->assessed = backup_todb($info['MOD']['#']['ASSESSED']['0']['#']); + $forum->scale = backup_todb($info['MOD']['#']['SCALE']['0']['#']); $forum->forcesubscribe = backup_todb($info['MOD']['#']['FORCESUBSCRIBE']['0']['#']); $forum->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']); + //We have to recode the scale field + $scale = backup_getid($restore->backup_unique_code,"scale",$forum->scale); + if ($scale) { + $forum->scale = $scale->new_id; + } + //The structure is equal to the db, so insert the forum $newid = insert_record ("forum",$forum); -- 2.39.5