Commit 0a597879 authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon
Browse files

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
parent 6930f6cd
......@@ -3428,7 +3428,7 @@ function xmldb_core_upgrade($oldversion=0) {
$todb->objectid = $record->view;
$todb->reportedby = 0;
$todb->report = '';
$todb->reportedtime = $record->ctime;
$todb->reportedtime = ($record->ctime) ? $record->ctime : format_date(time());
if (!empty($record->stopdate)) {
// Since we can't get an ID of a user who resolved an issue, use root ID.
$todb->resolvedby = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment