From 04ba976a04f7d57873778a46552640bbb0d43aa2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 14 Feb 2014 15:56:25 -0800 Subject: [PATCH] Remove references to legacy comment IDs Summary: Ref T2222. I want to stage a "later" patch to drop this column, but get rid of the last few references to it. One of these methods has no callers, and the other stuff I've updated to use the modern fields. Test Plan: Created some inlines, hit "edit", submitted them, `grep. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2222 Differential Revision: https://secure.phabricator.com/D8240 --- .../DifferentialInlineCommentEditController.php | 5 +++-- .../query/DifferentialInlineCommentQuery.php | 12 ------------ .../storage/DifferentialInlineComment.php | 8 +------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php index c09caa9374..619990b731 100644 --- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php +++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php @@ -60,8 +60,9 @@ final class DifferentialInlineCommentEditController return false; } - // Saved comments may not be edited. - if ($inline->getCommentID()) { + // Saved comments may not be edited, for now, although the schema now + // supports it. + if (!$inline->isDraft()) { return false; } diff --git a/src/applications/differential/query/DifferentialInlineCommentQuery.php b/src/applications/differential/query/DifferentialInlineCommentQuery.php index 8eb59760c1..cd338b74c1 100644 --- a/src/applications/differential/query/DifferentialInlineCommentQuery.php +++ b/src/applications/differential/query/DifferentialInlineCommentQuery.php @@ -45,11 +45,6 @@ final class DifferentialInlineCommentQuery return $this; } - public function withCommentIDs(array $comment_ids) { - $this->commentIDs = $comment_ids; - return $this; - } - public function execute() { $table = new DifferentialTransactionComment(); $conn_r = $table->establishConnection('r'); @@ -155,13 +150,6 @@ final class DifferentialInlineCommentQuery $this->draftsByAuthors); } - if ($this->commentIDs) { - $where[] = qsprintf( - $conn_r, - 'legacyCommentID IN (%Ld)', - $this->commentIDs); - } - return $this->formatWhereClause($where); } diff --git a/src/applications/differential/storage/DifferentialInlineComment.php b/src/applications/differential/storage/DifferentialInlineComment.php index 4e7dcf47a7..928104d9d6 100644 --- a/src/applications/differential/storage/DifferentialInlineComment.php +++ b/src/applications/differential/storage/DifferentialInlineComment.php @@ -167,7 +167,6 @@ final class DifferentialInlineComment // the future transaction. public function setCommentID($id) { - $this->proxy->setLegacyCommentID($id); $this->proxy->setTransactionPHID( PhabricatorPHID::generateNewPHID( PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST, @@ -175,11 +174,6 @@ final class DifferentialInlineComment return $this; } - public function getCommentID() { - return $this->proxy->getLegacyCommentID(); - } - - /* -( PhabricatorMarkupInterface Implementation )-------------------------- */ @@ -202,7 +196,7 @@ final class DifferentialInlineComment public function shouldUseMarkupCache($field) { // Only cache submitted comments. - return ($this->getID() && $this->getCommentID()); + return ($this->getID() && !$this->isDraft()); } }