1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00

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
This commit is contained in:
epriestley 2018-06-25 05:59:35 -07:00
parent cac3dc4983
commit f94cee8628

View file

@ -85,8 +85,10 @@ final class TransactionSearchConduitAPIMethod
$xactions = $xaction_query->executeWithCursorPager($pager);
$comment_map = array();
if ($xactions) {
$template = head($xactions)->getApplicationTransactionCommentObject();
if ($template) {
$query = new PhabricatorApplicationTransactionTemplatedCommentQuery();
@ -99,8 +101,7 @@ final class TransactionSearchConduitAPIMethod
$comment_map = msort($comment_map, 'getCommentVersion');
$comment_map = array_reverse($comment_map);
$comment_map = mgroup($comment_map, 'getTransactionPHID');
} else {
$comment_map = array();
}
}
$modular_classes = array();