@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.

Fix rendering of comments deleted by editing

Summary:
Fixes T4609. Steps are:

- Make a comment.
- Edit it.
- Delete all the text.

We expect to see "This comment has been deleted." -- instead, things currently render goofy.

Root cause is that `hasComment()` means both "comment object exists" //and// "comment object is nonempty".

Test Plan: {F128862}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Maniphest Tasks: T4609

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

+6 -2
+6 -2
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
··· 200 200 $engine = $this->getOrBuildEngine(); 201 201 $comment = $xaction->getComment(); 202 202 203 - if ($xaction->hasComment()) { 203 + if ($comment) { 204 204 if ($comment->getIsDeleted()) { 205 205 return phutil_tag( 206 206 'em', 207 207 array(), 208 208 pht('This comment has been deleted.')); 209 - } else { 209 + } else if ($xaction->hasComment()) { 210 210 return $engine->getOutput($comment, $field); 211 + } else { 212 + // This is an empty, non-deleted comment. Usually this happens when 213 + // rendering previews. 214 + return null; 211 215 } 212 216 } 213 217