Merged from stable.

Don't run the cleanup code if we are upgrading from a version that does
not already have an assignment type field. Bug 3801.
This commit is contained in:
ikawhero
2005-07-23 10:53:25 +00:00
parent 58422ddf4d
commit 0acfda862b
+14 -1
View File
@@ -29,7 +29,20 @@ function online_assignment_cleanup($output=false) {
echo '<center>';
}
// get the module id for assignments from db
/// We don't want to run this code if we are doing an upgrade from an assignment
/// version earlier than 2005041400
/// because the assignment type field will not exist
$amv = get_field('modules', 'version', 'name', 'assignment');
if ((int)$amv < 2005041400) {
if ($output) {
echo '</center>';
}
return;
}
/// get the module id for assignments from db
$arecord = get_record('modules', 'name', 'assignment');
$aid = $arecord->id;