Hide direct accesses to Audit inline comment table behind API

Summary: Ref T4896. Move all direct accesses to the inline comment table behind a small amount of API to make it easier to migrate the table.

Test Plan:
  - Grepped for `PhabricatorAuditInlineComment`.
  - Grepped for `audit_inlinecomment`.
  - Created a draft comment.
  - Previewed a draft comment.
  - Reloaded page, still saw draft.
  - Viewed standalone, still saw draft.
  - Made comment, inline published.
  - Added a draft, saw both.
  - Edited inline comment.
  - Reindexed commit.
  - Searched for unique word in published comment, found commit.
  - Searched for unique word in draft comment, no results.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T4896

Differential Revision: https://secure.phabricator.com/D10016
This commit is contained in:
epriestley
2014-07-24 17:59:28 -07:00
parent 023dee0d3b
commit 8605a1808d
6 changed files with 53 additions and 20 deletions

View File

@@ -86,12 +86,10 @@ final class DiffusionDiffController extends DiffusionController {
$parser->setWhitespaceMode(
DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
$inlines = id(new PhabricatorAuditInlineComment())->loadAllWhere(
'commitPHID = %s AND pathID = %d AND
(authorPHID = %s OR auditCommentID IS NOT NULL)',
$inlines = PhabricatorAuditInlineComment::loadDraftAndPublishedComments(
$user,
$drequest->loadCommit()->getPHID(),
$path_id,
$user->getPHID());
$path_id);
if ($inlines) {
foreach ($inlines as $inline) {