@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't publish "empty" inline comments

Summary:
Ref T13513. Currently, if you start an inline and then submit overall comments, we publish an empty inline. This is literally faithful to what you did, but almost certainly not the intent.

Instead, simply ignore empty inlines at publishing time (and ignore "done" state changes for those comments).

We could delete them outright, but if we do, they'll break if you have another window open with the empty inline (since the stored comment won't exist anymore). At least for now, leave them in place.

Test Plan: Created empty inlines, submitted comments, no longer saw them publish.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21211

+21 -1
+4
src/applications/audit/storage/PhabricatorAuditTransactionComment.php
··· 81 81 return $this; 82 82 } 83 83 84 + public function isEmptyInlineComment() { 85 + return !strlen($this->getContent()); 86 + } 87 + 84 88 }
+4
src/applications/differential/storage/DifferentialTransactionComment.php
··· 127 127 return $this; 128 128 } 129 129 130 + public function isEmptyInlineComment() { 131 + return !strlen($this->getContent()); 132 + } 133 + 130 134 }
+13 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 5033 5033 5034 5034 $xactions = array(); 5035 5035 5036 - foreach ($inlines as $inline) { 5036 + foreach ($inlines as $key => $inline) { 5037 + if ($inline->isEmptyInlineComment()) { 5038 + unset($inlines[$key]); 5039 + continue; 5040 + } 5041 + 5037 5042 $xactions[] = $object->getApplicationTransactionTemplate() 5038 5043 ->setTransactionType($transaction_type) 5039 5044 ->attachComment($inline); ··· 5078 5083 } 5079 5084 5080 5085 $inlines = array_mergev($inlines); 5086 + 5087 + foreach ($inlines as $key => $inline) { 5088 + if ($inline->isEmptyInlineComment()) { 5089 + unset($inlines[$key]); 5090 + continue; 5091 + } 5092 + } 5081 5093 5082 5094 if (!$inlines) { 5083 5095 return null;