diff --git a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php index 2a5c2b1ee8..693dc2f9be 100644 --- a/src/applications/audit/storage/PhabricatorAuditTransactionComment.php +++ b/src/applications/audit/storage/PhabricatorAuditTransactionComment.php @@ -81,4 +81,8 @@ final class PhabricatorAuditTransactionComment return $this; } + public function isEmptyInlineComment() { + return !strlen($this->getContent()); + } + } diff --git a/src/applications/differential/storage/DifferentialTransactionComment.php b/src/applications/differential/storage/DifferentialTransactionComment.php index 257b205a58..bbbf1abc5a 100644 --- a/src/applications/differential/storage/DifferentialTransactionComment.php +++ b/src/applications/differential/storage/DifferentialTransactionComment.php @@ -127,4 +127,8 @@ final class DifferentialTransactionComment return $this; } + public function isEmptyInlineComment() { + return !strlen($this->getContent()); + } + } diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 9d000a9c45..4344bc4aa4 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -5033,7 +5033,12 @@ abstract class PhabricatorApplicationTransactionEditor $xactions = array(); - foreach ($inlines as $inline) { + foreach ($inlines as $key => $inline) { + if ($inline->isEmptyInlineComment()) { + unset($inlines[$key]); + continue; + } + $xactions[] = $object->getApplicationTransactionTemplate() ->setTransactionType($transaction_type) ->attachComment($inline); @@ -5079,6 +5084,13 @@ abstract class PhabricatorApplicationTransactionEditor $inlines = array_mergev($inlines); + foreach ($inlines as $key => $inline) { + if ($inline->isEmptyInlineComment()) { + unset($inlines[$key]); + continue; + } + } + if (!$inlines) { return null; }