Skip to content
Browse files

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.
  • Loading branch information...
1 parent 58422dd commit 0acfda862bd6e954e12ce769caecb6d237fcced8 ikawhero committed
Showing with 14 additions and 1 deletion.
  1. +14 −1 admin/oacleanup.php
View
15 admin/oacleanup.php
@@ -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;

0 comments on commit 0acfda8

Please sign in to comment.
Something went wrong with that request. Please try again.