mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 01:02:42 +01:00
Use ManiphestTransactionQuery directly in maniphest.gettasktransactions
Summary: Ref T2217. Nukes a LegacyQuery callsite. Test Plan: Called method using console, verified data looks sane. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2217 Differential Revision: https://secure.phabricator.com/D7077
This commit is contained in:
parent
02ed9f1368
commit
425590a03a
1 changed files with 15 additions and 5 deletions
|
@ -39,24 +39,34 @@ final class ConduitAPI_maniphest_gettasktransactions_Method
|
||||||
->execute();
|
->execute();
|
||||||
$tasks = mpull($tasks, null, 'getPHID');
|
$tasks = mpull($tasks, null, 'getPHID');
|
||||||
|
|
||||||
$transactions = ManiphestLegacyTransactionQuery::loadByTasks(
|
$transactions = array();
|
||||||
$request->getUser(),
|
if ($tasks) {
|
||||||
$tasks);
|
$transactions = id(new ManiphestTransactionQuery())
|
||||||
|
->setViewer($request->getUser())
|
||||||
|
->withObjectPHIDs(mpull($tasks, 'getPHID'))
|
||||||
|
->needComments(true)
|
||||||
|
->execute();
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
$task_phid = $transaction->getTaskPHID();
|
$task_phid = $transaction->getObjectPHID();
|
||||||
if (empty($tasks[$task_phid])) {
|
if (empty($tasks[$task_phid])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$task_id = $tasks[$task_phid]->getID();
|
$task_id = $tasks[$task_phid]->getID();
|
||||||
|
|
||||||
|
$comments = null;
|
||||||
|
if ($transaction->hasComment()) {
|
||||||
|
$comments = $transaction->getComment()->getContent();
|
||||||
|
}
|
||||||
|
|
||||||
$results[$task_id][] = array(
|
$results[$task_id][] = array(
|
||||||
'taskID' => $task_id,
|
'taskID' => $task_id,
|
||||||
'transactionType' => $transaction->getTransactionType(),
|
'transactionType' => $transaction->getTransactionType(),
|
||||||
'oldValue' => $transaction->getOldValue(),
|
'oldValue' => $transaction->getOldValue(),
|
||||||
'newValue' => $transaction->getNewValue(),
|
'newValue' => $transaction->getNewValue(),
|
||||||
'comments' => $transaction->getComments(),
|
'comments' => $comments,
|
||||||
'authorPHID' => $transaction->getAuthorPHID(),
|
'authorPHID' => $transaction->getAuthorPHID(),
|
||||||
'dateCreated' => $transaction->getDateCreated(),
|
'dateCreated' => $transaction->getDateCreated(),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue