mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +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:
parent
cac3dc4983
commit
f94cee8628
1 changed files with 12 additions and 11 deletions
|
@ -85,8 +85,10 @@ final class TransactionSearchConduitAPIMethod
|
||||||
|
|
||||||
$xactions = $xaction_query->executeWithCursorPager($pager);
|
$xactions = $xaction_query->executeWithCursorPager($pager);
|
||||||
|
|
||||||
|
$comment_map = array();
|
||||||
if ($xactions) {
|
if ($xactions) {
|
||||||
$template = head($xactions)->getApplicationTransactionCommentObject();
|
$template = head($xactions)->getApplicationTransactionCommentObject();
|
||||||
|
if ($template) {
|
||||||
|
|
||||||
$query = new PhabricatorApplicationTransactionTemplatedCommentQuery();
|
$query = new PhabricatorApplicationTransactionTemplatedCommentQuery();
|
||||||
|
|
||||||
|
@ -99,8 +101,7 @@ final class TransactionSearchConduitAPIMethod
|
||||||
$comment_map = msort($comment_map, 'getCommentVersion');
|
$comment_map = msort($comment_map, 'getCommentVersion');
|
||||||
$comment_map = array_reverse($comment_map);
|
$comment_map = array_reverse($comment_map);
|
||||||
$comment_map = mgroup($comment_map, 'getTransactionPHID');
|
$comment_map = mgroup($comment_map, 'getTransactionPHID');
|
||||||
} else {
|
}
|
||||||
$comment_map = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$modular_classes = array();
|
$modular_classes = array();
|
||||||
|
|
Loading…
Reference in a new issue