Undefined property: stdClass::$logoxs due to wrong order of the upgrade tasks (upgrading from 16.10.9 to 17.10.4)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Unassigned | ||
17.10 |
Fix Released
|
Medium
|
Unassigned | ||
18.04 |
Fix Released
|
Medium
|
Unassigned | ||
18.10 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
We are working on upgrading from 16.10.9 to 17.10.4 (skipping 17.04 release) and noticed that the upgrade task "Realease all collections that are still submitted but to a deleted group" throws numerous warnings about undefined property $logoxs as it tries to update affected collections records and can't find logoxs column as it is not yet added in our case!
[Tue Apr 24 15:54:57.831640 2018] [:error] [pid 2181] [client 172.28.128.1:61016] [DBG] b8 (lib/db/
[Tue Apr 24 15:54:59.949311 2018] [:error] [pid 2181] [client 172.28.128.1:61016] [WAR] b8 (auth/user.php:946) Undefined property: stdClass::$logoxs, referer: https:/
[Tue Apr 24 15:54:59.949344 2018] [:error] [pid 2181] [client 172.28.128.1:61016] Call stack (most recent first):, referer: https:/
[Tue Apr 24 15:54:59.949347 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * log_message(
[Tue Apr 24 15:54:59.949349 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * error(8, "Undefined property: stdClass::$logoxs", "/htdocs/
[Tue Apr 24 15:54:59.949351 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * User->reset_
[Tue Apr 24 15:54:59.949353 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * User->find_
[Tue Apr 24 15:54:59.949355 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View->get_
[Tue Apr 24 15:54:59.949357 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View->is_
[Tue Apr 24 15:54:59.949359 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View::get_
[Tue Apr 24 15:54:59.949361 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection->views() at /htdocs/
[Tue Apr 24 15:54:59.949363 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection-
[Tue Apr 24 15:54:59.949365 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection-
[Tue Apr 24 15:54:59.949405 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * xmldb_core_
[Tue Apr 24 15:54:59.949453 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * upgrade_
[Tue Apr 24 15:54:59.949469 2018] [:error] [pid 2181] [client 172.28.128.1:61016] , referer: https:/
[Tue Apr 24 15:54:59.954950 2018] [:error] [pid 2181] [client 172.28.128.1:61016] [WAR] b8 (auth/user.php:946) Undefined property: stdClass::$logoxs, referer: https:/
Call stack (most recent first):
log_message(
error(8, "Undefined property: stdClass::$logoxs", "/htdocs/
User->reset_
User->find_
View->get_
View->get_
View::get_
Collection->views() at /htdocs/
Collection-
Collection-
xmldb_core_
upgrade_
This erroring task is a fix for the "Mahara Bug 1642389 Deleting a group with collections submission does not really release them" and if not wrong was released with Mahara 17.04 series. This task calls a public function find_by_id and within it reset_institutions (/htdocs/
Later on, a new feature “Bug 1676214: Added institution small logo upload” was released with Mahara 17.10 series and adds a new column logoxs.
Simply, changing the order of upgrade tasks starting from 17.10 series will fix this issue. Note that anyone who is upgrading from pre-17.04 release to 17.10 and affected with bug 1642389 will experience the same issue.
As of Mahara 17.10, the order of upgrade tasks (/htdocs/
1. Add logoxs column
if ($oldversion < 2017061200) {
$table = new XMLDBTable(
$field = new XMLDBField(
if (!field_
}
}
2. Release all collections
if ($oldversion < 2016112400) {
if ($collections = get_records_
SELECT c.id
FROM {collection} c JOIN {group} g ON c.submittedgrou
WHERE c.submittedstatus = ".Collection:
)) {
foreach ($collections as $collectionid) {
}
}
}
Changed in mahara: | |
importance: | Undecided → Medium |
Tried to push this through make push (gerrit) and minaccept fails. Seems the section number is not incremented correctly. Updating it to 2017061200 will run this twice who are upgrading from 17.04 to 17.10 and don't think it can harm!
make minaccept lib/db/ upgrade. php lib/db/ upgrade. php: 2016112400 lib/db/ upgrade. php section number 2016112400 not incremented correctly. lib/version. php should match version of last new section in htdocs/ lib/db/ upgrade. php
Running minimum acceptance test...
No syntax errors detected in htdocs/
New htdocs/
ERROR: htdocs/
ERROR: Version in htdocs/
make: *** [minaccept] Error 1