Commit db0b49d4 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1728815: Not include the logoxs column in sql query until it exists

As it causes problems on upgrade


Change-Id: Id330f8c31c763dffce6f559557c9c78ac27ac58f
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
(cherry picked from commit 35d46f1d)
parent c61bab91
......@@ -1805,8 +1805,16 @@ function load_user_institutions($userid) {
throw new InvalidArgumentException("couldn't load institutions, no user id specified");
$userid = (int) $userid;
$table = new XMLDBTable('institution');
$field = new XMLDBField('logoxs');
$logoxs = field_exists($table, $field) ? ',i.logoxs' : '';
if ($userid !== 0 && $institutions = get_records_sql_assoc('
SELECT u.institution,'.db_format_tsfield('ctime').','.db_format_tsfield('u.expiry', 'membership_expiry').',u.studentid,u.staff,u.admin,i.displayname,i.theme,i.registerallowed, i.showonlineusers,i.allowinstitutionpublicviews, i.logo, i.logoxs,, i.licensemandatory, i.licensedefault, i.dropdownmenu, i.skins, i.suspended
SELECT u.institution, ' . db_format_tsfield('ctime') . ',' . db_format_tsfield('u.expiry', 'membership_expiry') . ',
u.studentid, u.staff, u.admin, i.displayname, i.theme, i.registerallowed, i.showonlineusers,
i.allowinstitutionpublicviews, i.logo' . $logoxs . ',, i.licensemandatory, i.licensedefault,
i.dropdownmenu, i.skins, i.suspended
FROM {usr_institution} u INNER JOIN {institution} i ON u.institution =
WHERE u.usr = ? ORDER BY i.priority DESC', array($userid))) {
return $institutions;
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