Commit 2e1fb390 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 4a9e6f29
......@@ -4923,7 +4923,9 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2017022500) {
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;
......
Supports Markdown
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