@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.

Fix querying for transactions over "transaction.search" when the object does not support comments

Summary: See PHI725. Ref T13151. We currently try to load comments unconditionally, but not all objects (like projects) have comments. Only try to load comments if an object actually has comments.

Test Plan: Queried for an object with no comments, like project `#masonry`, via `transaction.search`.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13151

Differential Revision: https://secure.phabricator.com/D19507

+12 -11
+12 -11
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
··· 85 85 86 86 $xactions = $xaction_query->executeWithCursorPager($pager); 87 87 88 + $comment_map = array(); 88 89 if ($xactions) { 89 90 $template = head($xactions)->getApplicationTransactionCommentObject(); 91 + if ($template) { 90 92 91 - $query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); 93 + $query = new PhabricatorApplicationTransactionTemplatedCommentQuery(); 92 94 93 - $comment_map = $query 94 - ->setViewer($viewer) 95 - ->setTemplate($template) 96 - ->withTransactionPHIDs(mpull($xactions, 'getPHID')) 97 - ->execute(); 95 + $comment_map = $query 96 + ->setViewer($viewer) 97 + ->setTemplate($template) 98 + ->withTransactionPHIDs(mpull($xactions, 'getPHID')) 99 + ->execute(); 98 100 99 - $comment_map = msort($comment_map, 'getCommentVersion'); 100 - $comment_map = array_reverse($comment_map); 101 - $comment_map = mgroup($comment_map, 'getTransactionPHID'); 102 - } else { 103 - $comment_map = array(); 101 + $comment_map = msort($comment_map, 'getCommentVersion'); 102 + $comment_map = array_reverse($comment_map); 103 + $comment_map = mgroup($comment_map, 'getTransactionPHID'); 104 + } 104 105 } 105 106 106 107 $modular_classes = array();