Fatal error upgrading from 1.4 or earlier to 1.10 or later, with objectionable content reports
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Invalid
|
Medium
|
Aaron Wells | ||
1.10 |
Fix Released
|
Medium
|
Aaron Wells | ||
15.04 |
Fix Released
|
Medium
|
Aaron Wells | ||
15.10 |
Invalid
|
Medium
|
Aaron Wells |
Bug Description
In Mahara 1.10, when we added objectionable item reporting to the forums, we migrated all the old objectionable item view_access records into the new "objectionable" table. Part of this upgrade took view_access.ctime and used it for the "reportdate" column in the objectionable table, because view_access.ctime is supposed to be not null.
But, if you upgraded from Mahara 1.4 or earlier, view_access.ctime is NULL (see https:/
To replicate:
1. Install Mahara 1.4
2. Create a page
3. Go to the page and use the "Report objectionable" button on it.
4. Upgrade to Mahara 1.10
Expected result: Successful upgrade
Actual result: Fatal error.
[WAR] bb (lib/dml.php:1046) Failed to get a recordset: postgres7 error: [-1: ERROR: null value in column "reportedtime" violates not-null constraint] in adodb_throw(INSERT INTO "objectionable" ("objecttype", "objectid", "reportedby", "report") VALUES (?, ?, ?, ?), Array)
[WAR] bb (lib/dml.php:1046) Command was: INSERT INTO "objectionable" ("objecttype", "objectid", "reportedby", "report") VALUES (?, ?, ?, ?) and values was (view,6,0,)
Call stack (most recent first):
* insert_
* xmldb_core_
* upgrade_
* upgrade_
A nonrecoverable error occurred. This probably means you have encountered a bug in the system(
It appears this was already fixed in 15.10 as part of one of the commits for Bug 1450680. But it wasn't backported to 15.04 and 1.10.