mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Don't include other users' unpublished drafts when counting Pholio inlines
Summary: Fixes T10886. This should get more formal some day, but just fix it for now. Test Plan: Reloaded mock with other unpublished draft inlines, saw accurate count. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10886 Differential Revision: https://secure.phabricator.com/D16087
This commit is contained in:
parent
e808963eae
commit
3b1c6073a5
1 changed files with 6 additions and 3 deletions
|
@ -137,9 +137,12 @@ final class PholioImageQuery
|
||||||
$all_files = mpull($all_files, null, 'getPHID');
|
$all_files = mpull($all_files, null, 'getPHID');
|
||||||
|
|
||||||
if ($this->needInlineComments) {
|
if ($this->needInlineComments) {
|
||||||
$all_inline_comments = id(new PholioTransactionComment())
|
// Only load inline comments the viewer has permission to see.
|
||||||
->loadAllWhere('imageid IN (%Ld)',
|
$all_inline_comments = id(new PholioTransactionComment())->loadAllWhere(
|
||||||
mpull($images, 'getID'));
|
'imageID IN (%Ld)
|
||||||
|
AND (transactionPHID IS NOT NULL OR authorPHID = %s)',
|
||||||
|
mpull($images, 'getID'),
|
||||||
|
$this->getViewer()->getPHID());
|
||||||
$all_inline_comments = mgroup($all_inline_comments, 'getImageID');
|
$all_inline_comments = mgroup($all_inline_comments, 'getImageID');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue