Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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...
commit c34efb3b8c7daaa7300cbbf09ae0d89da55810c2 1 parent 890a6a5
ikawhero authored
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;
Please sign in to comment.
Something went wrong with that request. Please try again.