Error when upgrading mahara from 1.8.2 to 15.04

Bug #1452450 reported by Son Nguyen on 2015-05-06
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
High
Son Nguyen
15.04
High
Unassigned
15.10
High
Son Nguyen

Bug Description

Reported from public

Error when upgrading from 1.8.2 to 15.04

[WAR] 53 (lib/errors.php:747) Failed to get a recordset: postgres8 error: [-1: ERROR: column "path" does not exist
LINE 4: WHERE path LIKE '%/49354/%' OR path LIKE '%/3846...
                          ^] in adodb_throw(
            SELECT DISTINCT id
            FROM "artefact"
            WHERE path LIKE '%/49354/%' OR path LIKE '%/3846/%' OR path LIKE '%/68/%' OR path LIKE '%/67/%' OR path LIKE '%/16/%' OR path LIKE '%/15/%' OR path LIKE '%/77/%'
            ORDER BY id, )
Command was:
            SELECT DISTINCT id
            FROM "artefact"
            WHERE path LIKE '%/49354/%' OR path LIKE '%/3846/%' OR path LIKE '%/68/%' OR path LIKE '%/67/%' OR path LIKE '%/16/%' OR path LIKE '%/15/%' OR path LIKE '%/77/%'
            ORDER BY id
Call stack (most recent first):
log_message("Failed to get a recordset: postgres8 error: [-1: E...", 8, true, true) at /var/www/mahara/lib/errors.php:97
log_warn("Failed to get a recordset: postgres8 error: [-1: E...") at /var/www/mahara/lib/errors.php:747
SQLException->__construct("Failed to get a recordset: postgres8 error: [-1: E...") at /var/www/mahara/lib/dml.php:847
get_column_sql(" SELECT DISTINCT id FROM {...") at /var/www/mahara/artefact/lib.php:1789
artefact_get_descendants(array(size 7)) at /var/www/mahara/artefact/lib.php:1295
ArtefactType::update_locked("3") at /var/www/mahara/lib/db/upgrade.php:3118
xmldb_core_upgrade("2013101410") at /var/www/mahara/lib/upgrade.php:359
upgrade_core(object(stdClass)) at /var/www/mahara/admin/upgrade.json.php:86
Performing upgrades...

Component or plugin From version To version Information
core 1.8.2 15.04.0  Failed to get a recordset: postgres8 error: [-1: ERROR: column "path" does not exist LINE 4: WHERE path LIKE '%/49354/%' OR path LIKE '%/3846... ^] in adodb_throw( SELECT DISTINCT id FROM "artefact" WHERE path LIKE '%/49354/%' OR path LIKE '%/3846/%' OR path LIKE '%/68/%' OR path LIKE '%/67/%' OR path LIKE '%/16/%' OR path LIKE '%/15/%' OR path LIKE '%/77/%' ORDER BY id, ) Command was: SELECT DISTINCT id FROM "artefact" WHERE path LIKE '%/49354/%' OR path LIKE '%/3846/%' OR path LIKE '%/68/%' OR path LIKE '%/67/%' OR path LIKE '%/16/%' OR path LIKE '%/15/%' OR path LIKE '%/77/%' ORDER BY id
Call stack (most recent first):
get_column_sql(" SELECT DISTINCT id FROM {...") at /var/www/mahara/artefact/lib.php:1789
artefact_get_descendants(array(size 7)) at /var/www/mahara/artefact/lib.php:1295
ArtefactType::update_locked("3") at /var/www/mahara/lib/db/upgrade.php:3118
xmldb_core_upgrade("2013101410") at /var/www/mahara/lib/upgrade.php:359
upgrade_core(object(stdClass)) at /var/www/mahara/admin/upgrade.json.php:86

I applied the patch, and the upgrade attempt now gives me about 15 errors of "undefined variable oldversion" in artefact/lib.php

Manually setting (ugly hack) $oldversion just above the version check allows the upgrade to complete without any additional errors.

Keith (e-keith) wrote :

New patch applied, upgrade from 1.8.2 to 15.04+patch went through with no errors.

Robert Lyon (robertl-9) on 2015-05-11
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-05-29
Changed in mahara:
status: Fix Committed → Fix Released
summary: - Error when upgrad mahara from 1.8.2 to 15.04
+ Error when upgrading mahara from 1.8.2 to 15.04

Does this need to be fixed for 15.10 as well?

Son Nguyen (ngson2000) wrote :

The patch https://reviews.mahara.org/4749 is merged to master (15.10)

Reviewed: https://reviews.mahara.org/5074
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/a227f3c76208d9178debcf36f4d4039d4b731f23
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit a227f3c76208d9178debcf36f4d4039d4b731f23
Author: Son Nguyen <email address hidden>
Date: Thu May 7 11:58:39 2015 +1200

Fix errors in artefact_get_descendants(). Bug 1452450

The 'path' column was not available before mahara 1.10

Change-Id: I147b62746f04d7a4145542007749cd1dd291baed
(cherry picked from commit edea7dde6b21821d2d9425b07f796c3112ea8d84)

Robert Lyon (robertl-9) on 2016-11-06
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers