Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15322101
D18667.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D18667.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D18667: Fix transaction queries using withComments() for transactions with no comments
Attached
Detach File
Event Timeline
Log In to Comment