From: stronk7 Date: Mon, 25 Aug 2003 17:23:31 +0000 (+0000) Subject: Changed to support "negative" values in scale field. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cd6232200cf3ecf70dc2653143b3c8b71340581d;p=moodle.git Changed to support "negative" values in scale field. --- diff --git a/mod/forum/restorelib.php b/mod/forum/restorelib.php index 0712389e83..2a13e8757c 100644 --- a/mod/forum/restorelib.php +++ b/mod/forum/restorelib.php @@ -60,10 +60,12 @@ $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