Permalink
Browse files

MDL-21160 database activity - remap scale on restore ; backported fro…

…m 19_STABLE
  • Loading branch information...
1 parent 949cf6c commit 1458cc73ed92a2a9639d0fe6e20484bdf216e027 @stronk7 stronk7 committed Dec 18, 2009
Showing with 8 additions and 0 deletions.
  1. +8 −0 mod/data/restorelib.php
@@ -93,6 +93,14 @@ function data_restore_mods($mod,$restore) {
$database->assesspublic = backup_todb($info['MOD']['#']['ASSESSPUBLIC']['0']['#']);
}
+ // We have to recode the scale field if it's <0 (positive is a grade, not a scale)
+ if ($database->scale < 0) {
+ $scale = backup_getid($restore->backup_unique_code, 'scale', abs($database->scale));
+ if ($scale) {
+ $database->scale = -($scale->new_id);
+ }
+ }
+
$newid = insert_record ('data', $database);
//Do some output

0 comments on commit 1458cc7

Please sign in to comment.