Page MenuHomePhabricator

D18667.diff
No OneTemporary

D18667.diff

diff --git a/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php b/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
--- a/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
+++ b/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php
@@ -203,16 +203,29 @@
$xaction = $this->getTemplateApplicationTransaction();
$comment = $xaction->getApplicationTransactionCommentObject();
- if ($this->withComments) {
- $joins[] = qsprintf(
- $conn,
- 'JOIN %T c ON x.phid = c.transactionPHID',
- $comment->getTableName());
+ // Not every transaction type has comments, so we may be able to
+ // implement this constraint trivially.
+
+ if (!$comment) {
+ if ($this->withComments) {
+ throw new PhabricatorEmptyQueryException();
+ } else {
+ // If we're querying for transactions with no comments and the
+ // transaction type does not support comments, we don't need to
+ // do anything.
+ }
} else {
- $joins[] = qsprintf(
- $conn,
- 'LEFT JOIN %T c ON x.phid = c.transactionPHID',
- $comment->getTableName());
+ if ($this->withComments) {
+ $joins[] = qsprintf(
+ $conn,
+ 'JOIN %T c ON x.phid = c.transactionPHID',
+ $comment->getTableName());
+ } else {
+ $joins[] = qsprintf(
+ $conn,
+ 'LEFT JOIN %T c ON x.phid = c.transactionPHID',
+ $comment->getTableName());
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 7, 11:31 PM (5 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7355960
Default Alt Text
D18667.diff (1 KB)

Event Timeline