Reviewed:  https://reviews.mahara.org/5625
Committed: 
https://git.nzoss.org.nz/mahara/mahara/commit/ea8ae38bf2822ab702578dd8f8df51e07e8596c2
Submitter: Robert Lyon (robe...@catalyst.net.nz)
Branch:    1.10_STABLE

commit ea8ae38bf2822ab702578dd8f8df51e07e8596c2
Author: Aaron Wells <aar...@catalyst.net.nz>
Date:   Thu Sep 10 19:16:14 2015 +1200

Fix crash during upgrade (Bug 1494152)

If you're upgrading from 1.4 or earlier, view_access.ctime
is sometimes NULL.

behatnotneeded: Covered by existing tests

Change-Id: I33ef7f80a3a0c4dde2787fc1ad4d3c05e60ba8eb
(cherry picked from commit 0a5978791d84b6618f19c173cd2d5f6bfd195104)

-- 
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/1494152

Title:
  Fatal error upgrading from 1.4 or earlier to 1.10 or later, with
  objectionable content reports

Status in Mahara:
  Invalid
Status in Mahara 1.10 series:
  Fix Committed
Status in Mahara 15.04 series:
  Fix Committed
Status in Mahara 15.10 series:
  Invalid

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://bugs.launchpad.net/bugs/1494128 ). So, this causes
  the upgrade to crash.

  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_record("objectionable", object(stdClass)) at 
/home/aaronw/www/mahara/htdocs/lib/db/upgrade.php:3383
    * xmldb_core_upgrade("2011061015") at 
/home/aaronw/www/mahara/htdocs/lib/upgrade.php:359
    * upgrade_core(object(stdClass)) at 
/home/aaronw/www/mahara/htdocs/lib/mahara.php:253
    * upgrade_mahara(array(size 14)) at 
/home/aaronw/www/mahara/htdocs/admin/cli/upgrade.php:50

  A nonrecoverable error occurred. This probably means you have
  encountered a bug in the system(1.10_STABLE)aaronw@vega

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1494152/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to