]> git.mjollnir.org Git - moodle.git/commitdiff
Changed to support "negative" values in scale field.
authorstronk7 <stronk7>
Mon, 25 Aug 2003 17:23:31 +0000 (17:23 +0000)
committerstronk7 <stronk7>
Mon, 25 Aug 2003 17:23:31 +0000 (17:23 +0000)
mod/forum/restorelib.php

index 0712389e839d45a75bf116d496fe86c7c78dfe8a..2a13e8757cff72cad90d002860216e785811027b 100644 (file)
             $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;
+            //We have to recode the scale field if it's <0 (default now always)
+            if ($forum->scale < 0) {
+                $scale = backup_getid($restore->backup_unique_code,"scale",abs($forum->scale));
+                if ($scale) {
+                    $forum->scale = -($scale->new_id);
+                }
             }
 
             //The structure is equal to the db, so insert the forum