Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14413811
D10019.id24079.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10019.id24079.diff
View Options
diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
@@ -40,8 +40,8 @@
$commit = $this->commit;
$actor = $this->getActor();
- $other_comments = id(new PhabricatorAuditComment())->loadAllWhere(
- 'targetPHID = %s',
+ $other_comments = PhabricatorAuditComment::loadComments(
+ $actor,
$commit->getPHID());
$inline_comments = array();
diff --git a/src/applications/audit/storage/PhabricatorAuditComment.php b/src/applications/audit/storage/PhabricatorAuditComment.php
--- a/src/applications/audit/storage/PhabricatorAuditComment.php
+++ b/src/applications/audit/storage/PhabricatorAuditComment.php
@@ -15,6 +15,15 @@
protected $content;
protected $metadata = array();
+ public static function loadComments(
+ PhabricatorUser $viewer,
+ $commit_phid) {
+
+ return id(new PhabricatorAuditComment())->loadAllWhere(
+ 'targetPHID = %s',
+ $commit_phid);
+ }
+
public function getConfiguration() {
return array(
self::CONFIG_SERIALIZATION => array(
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -643,8 +643,8 @@
private function buildComments(PhabricatorRepositoryCommit $commit) {
$user = $this->getRequest()->getUser();
- $comments = id(new PhabricatorAuditComment())->loadAllWhere(
- 'targetPHID = %s ORDER BY dateCreated ASC',
+ $comments = PhabricatorAuditComment::loadComments(
+ $user,
$commit->getPHID());
$inlines = PhabricatorAuditInlineComment::loadPublishedComments(
diff --git a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php
--- a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php
+++ b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php
@@ -66,8 +66,8 @@
PhabricatorRepositoryPHIDTypeRepository::TYPECONST,
$date_created);
- $comments = id(new PhabricatorAuditComment())->loadAllWhere(
- 'targetPHID = %s',
+ $comments = PhabricatorAuditComment::loadComments(
+ $this->getViewer(),
$commit->getPHID());
foreach ($comments as $comment) {
if (strlen($comment->getContent())) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 2:40 PM (4 h, 17 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6926764
Default Alt Text
D10019.id24079.diff (2 KB)
Attached To
Mode
D10019: Hide Audit comment table reads behind an API
Attached
Detach File
Event Timeline
Log In to Comment