Page MenuHomePhabricator

D21287.id.diff
No OneTemporary

D21287.id.diff

diff --git a/src/applications/differential/storage/DifferentialTransactionComment.php b/src/applications/differential/storage/DifferentialTransactionComment.php
--- a/src/applications/differential/storage/DifferentialTransactionComment.php
+++ b/src/applications/differential/storage/DifferentialTransactionComment.php
@@ -144,4 +144,16 @@
return $this;
}
+
+ public function isEmptyComment() {
+ if (!parent::isEmptyComment()) {
+ return false;
+ }
+
+ return $this->newInlineCommentObject()
+ ->getContentState()
+ ->isEmptyContentState();
+ }
+
+
}
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -127,15 +127,12 @@
}
public function hasComment() {
- if (!$this->getComment()) {
+ $comment = $this->getComment();
+ if (!$comment) {
return false;
}
- $content = $this->getComment()->getContent();
-
- // If the content is empty or consists of only whitespace, don't count
- // this as comment.
- if (!strlen(trim($content))) {
+ if ($comment->isEmptyComment()) {
return false;
}
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php
@@ -107,6 +107,18 @@
$this->getTransactionPHID());
}
+ public function isEmptyComment() {
+ $content = $this->getContent();
+
+ // The comment is empty if there's no content, or if the content only has
+ // whitespace.
+ if (!strlen(trim($content))) {
+ return true;
+ }
+
+ return false;
+ }
+
/* -( PhabricatorMarkupInterface )----------------------------------------- */

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 10, 9:23 AM (2 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7116575
Default Alt Text
D21287.id.diff (2 KB)

Event Timeline