From 703e0b396888dc2dad9b0db45ebf6edaa44c6596 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 19 May 2014 12:39:26 -0700 Subject: [PATCH] Disable the edit/quote menu for non-standard comments Summary: Fixes T4930. We currently show the edit/quote menu if a transaction group has //inline// comments, but this doesn't make sense and doesn't work properly. Only show this menu if the group has a normal comment. Test Plan: Viewed these groups: - Normal comment (edits fine). - Just inlines (no more edit menu). - Inline + comment (edits fine, affects the normal comment properly). Reviewers: btrahan Reviewed By: btrahan Subscribers: bitglue, epriestley Maniphest Tasks: T4930 Differential Revision: https://secure.phabricator.com/D9180 --- .../PhabricatorApplicationTransactionView.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php index 64d9cd4c11..524b476520 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -382,13 +382,22 @@ class PhabricatorApplicationTransactionView extends AphrontView { ->setAnchor($anchor); } - $has_deleted_comment = $xaction->getComment() && - $xaction->getComment()->getIsDeleted(); + $transaction_type = $xaction->getTransactionType(); + $comment_type = PhabricatorTransactions::TYPE_COMMENT; + $is_normal_comment = ($transaction_type == $comment_type); - $has_removed_comment = $xaction->getComment() && - $xaction->getComment()->getIsRemoved(); + if ($this->getShowEditActions() && + !$this->isPreview && + $is_normal_comment) { + + $has_deleted_comment = + $xaction->getComment() && + $xaction->getComment()->getIsDeleted(); + + $has_removed_comment = + $xaction->getComment() && + $xaction->getComment()->getIsRemoved(); - if ($this->getShowEditActions() && !$this->isPreview) { if ($xaction->getCommentVersion() > 1 && !$has_removed_comment) { $event->setIsEdited(true); }