mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #19622
[Bug 1338410] Re: Duplicate primary key upgrading from Mahara 1.1
Problem is the code that inserts the "about me" block, is not correctly
determining what value should go in the "block_instance.order" column.
It counts the number of blocks in that row and adds 1. That would work
if the contents of the "order" column are always correct, but in
instances upgraded from Mahara 1.1, the values of that column are "2,
3", so the count method doesn't work because it also gives you "3".
A more robust solution is to get the maximum "order" value and add 1 to
that.
--
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/1338410
Title:
Duplicate primary key upgrading from Mahara 1.1
Status in Mahara ePortfolio:
In Progress
Bug description:
[DBG] a2 (lib/db/upgrade.php:2881) Correcting custom layout table structures.
[WAR] a2 (lib/errors.php:739) Failed to get a recordset: postgres7 error: [-5: ERROR: duplicate key value violates unique constraint "blocinst_vierowcolord_uk"
[WAR] a2 (lib/errors.php:739) DETAIL: Key (view, "row", "column", "order")=(1, 1, 1, 3) already exists.] in adodb_throw(INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "column", "order", "row") VALUES (?, ?, ?, ?, ?, ?, ?, ?), Array)
[WAR] a2 (lib/errors.php:739) Command was: INSERT INTO "block_instance" ("id", "blocktype", "title", "configdata", "view", "column", "order", "row") VALUES (?, ?, ?, ?, ?, ?, ?, ?) and values was (13,profileinfo,About me,a:0:{},1,1,3,1)
Call stack (most recent first):
* log_message("Failed to get a recordset: postgres7 error: [-5: E...", 8, true, true) at /home/aaronw/www/mahara/htdocs/lib/errors.php:95
* log_warn("Failed to get a recordset: postgres7 error: [-5: E...") at /home/aaronw/www/mahara/htdocs/lib/errors.php:739
* SQLException->__construct("Failed to get a recordset: postgres7 error: [-5: E...") at /home/aaronw/www/mahara/htdocs/lib/dml.php:1046
* insert_record("block_instance", object(stdClass), "id", true) at /home/aaronw/www/mahara/htdocs/blocktype/lib.php:1029
* BlockInstance->commit() at /home/aaronw/www/mahara/htdocs/lib/db/upgrade.php:3245
* xmldb_core_upgrade("2009022600") at /home/aaronw/www/mahara/htdocs/lib/upgrade.php:325
* upgrade_core(object(stdClass)) at /home/aaronw/www/mahara/htdocs/lib/mahara.php:253
* upgrade_mahara(array(size 20)) at /home/aaronw/www/mahara/htdocs/admin/cli/upgrade.php:50
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1338410/+subscriptions
References