mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
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
This commit is contained in:
parent
838f781285
commit
48910537b9
1 changed files with 6 additions and 2 deletions
|
@ -200,14 +200,18 @@ class PhabricatorApplicationTransactionView extends AphrontView {
|
|||
$engine = $this->getOrBuildEngine();
|
||||
$comment = $xaction->getComment();
|
||||
|
||||
if ($xaction->hasComment()) {
|
||||
if ($comment) {
|
||||
if ($comment->getIsDeleted()) {
|
||||
return phutil_tag(
|
||||
'em',
|
||||
array(),
|
||||
pht('This comment has been deleted.'));
|
||||
} else {
|
||||
} else if ($xaction->hasComment()) {
|
||||
return $engine->getOutput($comment, $field);
|
||||
} else {
|
||||
// This is an empty, non-deleted comment. Usually this happens when
|
||||
// rendering previews.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue