Commit 525c7213 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1656699: Check table exists before trying to update it



Problem when upgrading from version where smartevidence does not exist

behatnotneeded

Change-Id: If2797efafa84fc3e6a90e9aef95ed4f4a3097796
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent dce255da
......@@ -4842,7 +4842,9 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2016090218) {
log_debug('Fixing spelling mistake in SmartEvidence status for PTC matrix');
execute_sql("UPDATE {framework_evidence_statuses} SET name = REPLACE(name, 'criterium', 'criterion') WHERE name LIKE '%criterium'");
if (table_exists(new XMLDBTable('framework_evidence_statuses'))) {
execute_sql("UPDATE {framework_evidence_statuses} SET name = REPLACE(name, 'criterium', 'criterion') WHERE name LIKE '%criterium'");
}
}
return $status;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment