Commit 354a5122 authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix issue found when attempting to upgrade a dupe of myportfolio.ac.nz - lang...

Fix issue found when attempting to upgrade a dupe of myportfolio.ac.nz - lang setting might already be fixed in the database, causing a foreign key violation
parent 2bad36da
......@@ -266,7 +266,9 @@ function xmldb_core_upgrade($oldversion=0) {
// everything up to here was pre mysql support.
if ($oldversion < 2007062000) {
execute_sql("INSERT INTO {$prefix}config (field, value) VALUES ('lang', (SELECT value FROM {$prefix}config WHERE field = 'language'))");
if (!get_record_array('config', 'field', 'lang')) {
execute_sql("INSERT INTO {$prefix}config (field, value) VALUES ('lang', (SELECT value FROM {$prefix}config WHERE field = 'language'))");
}
delete_records('config', 'field', 'language');
}
......
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