Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14895735
D21287.id.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
D21287.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21287: Fix an issue where inline comments with only edit suggestions are considered empty
Attached
Detach File
Event Timeline
Log In to Comment