From c34efb3b8c7daaa7300cbbf09ae0d89da55810c2 Mon Sep 17 00:00:00 2001 From: ikawhero Date: Sat, 23 Jul 2005 10:49:50 +0000 Subject: [PATCH] Don't run the cleanup code if we are upgrading from a version that does not already have an assignment type field. Bug 3801. --- admin/oacleanup.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/admin/oacleanup.php b/admin/oacleanup.php index 4c89b8b1804..2ae2c203016 100644 --- a/admin/oacleanup.php +++ b/admin/oacleanup.php @@ -29,7 +29,20 @@ function online_assignment_cleanup($output=false) { echo '
'; } - // 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 '
'; + } + return; + } + + + /// get the module id for assignments from db $arecord = get_record('modules', 'name', 'assignment'); $aid = $arecord->id;