Commit 7a79c29c authored by Robert Lyon's avatar Robert Lyon
Browse files

Cleaning up bad data created by problem with user csv upload



Bug 1296915

Change-Id: I572e066162e6b26630c887a66400098d90638122
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8bc160a6
......@@ -3188,5 +3188,16 @@ function xmldb_core_upgrade($oldversion=0) {
install_watchlist_notification();
}
if ($oldversion < 2014032700) {
// Remove bad data created by the upload user via csv where users in no institution
// have 'licensedefault' set causing an error
execute_sql("DELETE FROM {usr_account_preference} WHERE FIELD = 'licensedefault' AND usr IN (
SELECT u.id FROM {usr} u
LEFT JOIN {usr_account_preference} uap ON uap.usr = u.id
LEFT JOIN {usr_institution} ui ON ui.usr = u.id
WHERE uap.field = 'licensedefault' AND (ui.institution = 'mahara' OR ui.institution is null)
)");
}
return $status;
}
......@@ -15,7 +15,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/index.php/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2014032600;
$config->version = 2014032700;
$config->release = '1.9.0dev';
$config->minupgradefrom = 2009022600;
$config->minupgraderelease = '1.1.0 (release tag 1.1.0_RELEASE)';
......
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