mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #48621
[Bug 1773043] Re: Undefined property: stdClass::$logoxs due to wrong order of the upgrade tasks (upgrading from 16.10.9 to 17.10.4)
** Changed in: mahara/17.10
Status: Fix Committed => Fix Released
** Changed in: mahara/18.04
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1773043
Title:
Undefined property: stdClass::$logoxs due to wrong order of the
upgrade tasks (upgrading from 16.10.9 to 17.10.4)
Status in Mahara:
Fix Committed
Status in Mahara 17.10 series:
Fix Released
Status in Mahara 18.04 series:
Fix Released
Status in Mahara 18.10 series:
Fix Committed
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/upgrade.php:4822) Realease all collections that are still submitted but to a deleted group, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[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://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949344 2018] [:error] [pid 2181] [client 172.28.128.1:61016] Call stack (most recent first):, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949347 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * log_message("Undefined property: stdClass::$logoxs", 8, true, true, "/htdocs/auth/user.ph...", 946) at /htdocs/lib/errors.php:521, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949349 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * error(8, "Undefined property: stdClass::$logoxs", "/htdocs/auth/user.ph...", 946, array(size 12)) at /htdocs/auth/user.php:946, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949351 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * User->reset_institutions() at /htdocs/auth/user.php:119, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949353 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * User->find_by_id("10896") at /htdocs/lib/view.php:858, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949355 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View->get_owner_object() at /htdocs/lib/view.php:2974, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949357 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View->is_staff_or_admin_for_page() at /htdocs/lib/view.php:5566, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949359 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * View::get_extra_view_info(array(size 7), false, false) at /htdocs/lib/collection.php:616, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949361 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection->views() at /htdocs/lib/collection.php:1195, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949363 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection->get_viewids() at /htdocs/lib/collection.php:1141, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949365 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * Collection->release() at /htdocs/lib/db/upgrade.php:4831, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949405 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * xmldb_core_upgrade("2016090236") at /htdocs/lib/upgrade.php:347, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949453 2018] [:error] [pid 2181] [client 172.28.128.1:61016] * upgrade_core(object(stdClass)) at /htdocs/admin/upgrade.json.php:87, referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[Tue Apr 24 15:54:59.949469 2018] [:error] [pid 2181] [client 172.28.128.1:61016] , referer: https://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
[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://localhost/admin/upgrade.php?urlsecret=WhoKnOwS
Call stack (most recent first):
log_message("Undefined property: stdClass::$logoxs", 8, true, true, "/htdocs/auth/user.ph...", 946) at /htdocs/lib/errors.php:521
error(8, "Undefined property: stdClass::$logoxs", "/htdocs/auth/user.ph...", 946, array(size 12)) at /htdocs/auth/user.php:946
User->reset_institutions() at /htdocs/auth/user.php:119
User->find_by_id("27969") at /htdocs/lib/view.php:858
View->get_owner_object() at /htdocs/lib/view.php:6193
View->get_url(false) at /htdocs/lib/view.php:5585
View::get_extra_view_info(array(size 6), false, false) at /htdocs/lib/collection.php:616
Collection->views() at /htdocs/lib/collection.php:1200
Collection->get_viewids() at /htdocs/lib/collection.php:1141
Collection->release() at /htdocs/lib/db/upgrade.php:4831
xmldb_core_upgrade("2016090236") at /htdocs/lib/upgrade.php:347
upgrade_core(object(stdClass)) at /htdocs/admin/upgrade.json.php:87
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/auth/user.php line 119 – Mahara 17.10.4) which is expecting a
logoxs column.
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/lib/db/upgrade.php) should change as following
1. Add logoxs column
if ($oldversion < 2017061200) {
log_debug('Add new logoxs column in institution table for small logos');
$table = new XMLDBTable('institution');
$field = new XMLDBField('logoxs');
if (!field_exists($table, $field)) {
$field->setAttributes(XMLDB_TYPE_INTEGER, 10);
add_field($table, $field);
}
}
2. Release all collections
if ($oldversion < 2016112400) {
log_debug('Realease all collections that are still submitted but to a deleted group');
require_once(get_config('libroot') . 'collection.php');
if ($collections = get_records_sql_array("
SELECT c.id
FROM {collection} c JOIN {group} g ON c.submittedgroup=g.id
WHERE c.submittedstatus = ".Collection::SUBMITTED." AND g.deleted = 1 "
)) {
foreach ($collections as $collectionid) {
$collection = new Collection($collectionid->id);
$collection->release();
}
}
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1773043/+subscriptions
References