]> git.mjollnir.org Git - moodle.git/commitdiff
Scales are now supported in forums backup and restore
authorstronk7 <stronk7>
Mon, 18 Aug 2003 00:03:40 +0000 (00:03 +0000)
committerstronk7 <stronk7>
Mon, 18 Aug 2003 00:03:40 +0000 (00:03 +0000)
mod/forum/backuplib.php
mod/forum/restorelib.php

index f41a9816244fa69072a1e87101e40005dc003437..6975fff10ef374c1e2f248d23980f5f1eda604ec 100644 (file)
@@ -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));
 
index 8b06931b2eec94d27fab970defc3a42bb658a8c3..6be7ecd17d21ab691d3deb33e6d9eeae7224d88b 100644 (file)
             $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);