1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00

Fix a MySQL strict issue with auxiliary task storage

Summary: This table has date columns but we don't populate them correctly. In strict mode with custom fields, this throws when creating a task.

Test Plan: Created a task in strict mode with custom fields.

Reviewers: chad, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D5137
This commit is contained in:
epriestley 2013-02-27 10:51:34 -08:00
parent 5d30b1b4fb
commit 8d20e42c1c

View file

@ -202,15 +202,18 @@ final class ManiphestTask extends ManiphestDAO
foreach ($update as $key => $val) {
$sql[] = qsprintf(
$conn_w,
'(%s, %s, %s)',
'(%s, %s, %s, %d, %d)',
$this->getPHID(),
$key,
$val);
$val,
time(),
time());
}
queryfx(
$conn_w,
'INSERT INTO %T (taskPHID, name, value) VALUES %Q
ON DUPLICATE KEY UPDATE value = VALUES(value)',
'INSERT INTO %T (taskPHID, name, value, dateCreated, dateModified)
VALUES %Q ON DUPLICATE KEY
UPDATE value = VALUES(value), dateModified = VALUES(dateModified)',
$table->getTableName(),
implode(', ', $sql));
}