@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+15 -5
+15 -5
src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php
··· 39 39 ->execute(); 40 40 $tasks = mpull($tasks, null, 'getPHID'); 41 41 42 - $transactions = ManiphestLegacyTransactionQuery::loadByTasks( 43 - $request->getUser(), 44 - $tasks); 42 + $transactions = array(); 43 + if ($tasks) { 44 + $transactions = id(new ManiphestTransactionQuery()) 45 + ->setViewer($request->getUser()) 46 + ->withObjectPHIDs(mpull($tasks, 'getPHID')) 47 + ->needComments(true) 48 + ->execute(); 49 + } 45 50 46 51 foreach ($transactions as $transaction) { 47 - $task_phid = $transaction->getTaskPHID(); 52 + $task_phid = $transaction->getObjectPHID(); 48 53 if (empty($tasks[$task_phid])) { 49 54 continue; 50 55 } 51 56 52 57 $task_id = $tasks[$task_phid]->getID(); 53 58 59 + $comments = null; 60 + if ($transaction->hasComment()) { 61 + $comments = $transaction->getComment()->getContent(); 62 + } 63 + 54 64 $results[$task_id][] = array( 55 65 'taskID' => $task_id, 56 66 'transactionType' => $transaction->getTransactionType(), 57 67 'oldValue' => $transaction->getOldValue(), 58 68 'newValue' => $transaction->getNewValue(), 59 - 'comments' => $transaction->getComments(), 69 + 'comments' => $comments, 60 70 'authorPHID' => $transaction->getAuthorPHID(), 61 71 'dateCreated' => $transaction->getDateCreated(), 62 72 );