Skip to content

Commit

Permalink
MDL-21160 database activity - remap scale on restore ; merged from 19…
Browse files Browse the repository at this point in the history
…_STABLE
  • Loading branch information
stronk7 committed Dec 18, 2009
1 parent 3e7ca6b commit 14594fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mod/data/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ function data_restore_mods($mod,$restore) {
unset($database->notification); /// Unset it if null to get proper Moodle 2.0 default (0) applied
}

// 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 = $DB->insert_record ('data', $database);

//Do some output
Expand Down Expand Up @@ -727,5 +735,3 @@ function data_decode_content_links_caller($restore) {

return $status;
}


0 comments on commit 14594fa

Please sign in to comment.