1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Fix a mistakenly translated query from D6262

Summary: Ref T2222. I didn't translate this query properly; reproduce the original.

Test Plan: When viewing a revision with non-draft inline comments by a user other than the viewer, the inline comments now appear on the changesets themselves.

Reviewers: kawakami, btrahan, garoevans

Reviewed By: garoevans

CC: aran, mbishopim3

Maniphest Tasks: T2222

Differential Revision: https://secure.phabricator.com/D6281
This commit is contained in:
epriestley 2013-06-24 07:42:37 -07:00
parent e40f0e13c5
commit d0da409eb0
2 changed files with 9 additions and 9 deletions

View file

@ -269,7 +269,7 @@ final class DifferentialChangesetViewController extends DifferentialController {
} }
return id(new DifferentialInlineCommentQuery()) return id(new DifferentialInlineCommentQuery())
->withAuthorAndChangesetIDs($author_phid, $changeset_ids) ->withViewerAndChangesetIDs($author_phid, $changeset_ids)
->execute(); ->execute();
} }

View file

@ -11,7 +11,7 @@ final class DifferentialInlineCommentQuery
private $ids; private $ids;
private $commentIDs; private $commentIDs;
private $authorAndChangesetIDs; private $viewerAndChangesetIDs;
private $draftComments; private $draftComments;
private $draftsByAuthors; private $draftsByAuthors;
@ -35,8 +35,8 @@ final class DifferentialInlineCommentQuery
return $this; return $this;
} }
public function withAuthorAndChangesetIDs($author_phid, array $ids) { public function withViewerAndChangesetIDs($author_phid, array $ids) {
$this->authorAndChangesetIDs = array($author_phid, $ids); $this->viewerAndChangesetIDs = array($author_phid, $ids);
return $this; return $this;
} }
@ -98,13 +98,13 @@ final class DifferentialInlineCommentQuery
$this->commentIDs); $this->commentIDs);
} }
if ($this->authorAndChangesetIDs) { if ($this->viewerAndChangesetIDs) {
list($phid, $ids) = $this->authorAndChangesetIDs; list($phid, $ids) = $this->viewerAndChangesetIDs;
$where[] = qsprintf( $where[] = qsprintf(
$conn_r, $conn_r,
'authorPHID = %s AND changesetID IN (%Ld)', 'changesetID IN (%Ld) AND (authorPHID = %s OR commentID IS NOT NULL)',
$phid, $ids,
$ids); $phid);
} }
if ($this->draftComments) { if ($this->draftComments) {