Reviewed: https://reviews.mahara.org/c/mahara/+/12520 Committed: https://git.mahara.org/mahara/mahara/commit/a9e2485a8f86ef5ec109cce250889c8b8740ebb3 Submitter: "Robert Lyon <[email protected]>" Branch: main
commit a9e2485a8f86ef5ec109cce250889c8b8740ebb3 Author: Robert Lyon <[email protected]> Date: Tue Mar 29 15:37:07 2022 +1300 Bug 1966816: Upgrade issue with supportadmin Change-Id: I6e35fda5a2dd87d8c0d38d77f18eee43a259345f Signed-off-by: Robert Lyon <[email protected]> -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: mahara-contributors https://bugs.launchpad.net/bugs/1966816 Title: Uggrading causes an error around the supportadmin filed not being present Status in Mahara: Fix Committed Bug description: When trying to upgrade from an older version we can encounter this problem at the step lib/db/upgrade.php line 2276 - Updating description text block image src attributes missing text parameter in url Failed to get a recordset: postgres9 error: [-1: ERROR: column u.supportadmin does not exist This is because the upgrade step that happens at 2021121500 calls a function that has a change in it for support admins but the db column isn't added until 2022031500 We need to adjust the function to only contain the new db column once site is newer than 2022031500 diff --git a/htdocs/lib/user.php b/htdocs/lib/user.php index 1f3be84148..cc4cdf19f9 100644 --- a/htdocs/lib/user.php +++ b/htdocs/lib/user.php @@ -1981,9 +1981,13 @@ function load_user_institutions($userid) { $logoxs = db_column_exists('institution', 'logoxs') ? ',i.logoxs' : ''; $tags = db_column_exists('institution', 'tags') ? ',i.tags' : ''; + $supportadmin = ''; + if (get_config('version') > 2022031500) { + $supportadmin = ' u.supportadmin,'; + } 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, u.supportadmin, i.displayname, i.theme, i.registerallowed, i.showonlineusers, + u.studentid, u.staff, u.admin,' . $supportadmin . ' i.displayname, i.theme, i.registerallowed, i.showonlineusers, i.allowinstitutionpublicviews, i.logo' . $logoxs . ', i.style, i.licensemandatory, i.licensedefault, i.dropdownmenu, i.skins, i.suspended' . $tags . ' FROM {usr_institution} u INNER JOIN {institution} i ON u.institution = i.name To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1966816/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

