upgrade to 1.9 error when logged in and belonging to an institution

Bug #1353153 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
1.9
Fix Released
High
Robert Lyon

Bug Description

If one is an institutional admin and they try to upgrade their site from pre 1.9 to 1.9+ they get this error

Wed Aug 06 10:01:17.952987 2014] [:error] [pid 22070] [client 127.0.0.1:32941] PHP Fatal error: Uncaught exception 'SQLException' with message 'Failed to get a recordset: postgres7 error: [-1: ERROR: relation "institution_config" does not exist\nLINE 1: SELECT field, value FROM "institution_config" WHERE "institu...\n ^]

There was a change made in 1.9 relating to language settings and one of the things it does is try to set a cookie relating to the institution language last used.

When one upgrades it logs them out as part of the process if they are logged in. And it tries to set their institution set language on logout in 1.9 getting info from the institution_config table (which does not exist at this point).

The setting of that cookie needs to be wrapped in a check to make sure the table exists first.

Revision history for this message
Robert Lyon (robertl-9) wrote :

To Test:

- Create a 1.8_STABLE site
- Create a new institution
- edit user you are logged in with and add them to institution.
- Checkout 1.9_STABLE (or master)
- Try to navigate in the site

Normally it should prompt you to upgrade

Instead white screen of death - and errors in the logs

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3574

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "1.9_STABLE" branch: https://reviews.mahara.org/3575

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/3574
Committed: http://gitorious.org/mahara/mahara/commit/e96eee4c7a8738b074da8063fc67afa09a1bb6fe
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit e96eee4c7a8738b074da8063fc67afa09a1bb6fe
Author: Robert Lyon <email address hidden>
Date: Wed Aug 6 10:48:07 2014 +1200

Logout setting of cookie breaks upgrade from pre 1.9 to 1.9+ (Bug #1353153)

If the user who is upgrading the site is logged into the site and is a
member of a normal (not mahara) institution it causes the upgrade to
break because the upgrade process tries to log them out and logout()
function tries to set a cookie and the cookie needs info from the
config_institution table and it doesn't exist yet.

Change-Id: Ib8bb83fc1b774cec5636af6009ebf9906349bca3
Signed-off-by: Robert Lyon <email address hidden>

Son Nguyen (ngson2000)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/3575
Committed: http://gitorious.org/mahara/mahara/commit/53d733273333da13d696f2fb81b4218baca1f051
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.9_STABLE

commit 53d733273333da13d696f2fb81b4218baca1f051
Author: Robert Lyon <email address hidden>
Date: Wed Aug 6 10:48:07 2014 +1200

Logout setting of cookie breaks upgrade from pre 1.9 to 1.9+ (Bug #1353153)

If the user who is upgrading the site is logged into the site and is a
member of a normal (not mahara) institution it causes the upgrade to
break because the upgrade process tries to log them out and logout()
function tries to set a cookie and the cookie needs info from the
config_institution table and it doesn't exist yet.

Change-Id: Ib8bb83fc1b774cec5636af6009ebf9906349bca3
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.