diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -296,12 +296,29 @@ private function renderCommentPanel() { $viewer = $this->getViewer(); + // Set placeholder in comment field if a duplicate task - T15749 + $placeholder_text = ''; + $object_phid = $this->getObjectPHID(); + if (substr_compare($object_phid, 'PHID-TASK-', 0, 10) === 0) { + $query = id(new ManiphestTaskQuery()) + ->setViewer(PhabricatorUser::getOmnipotentUser()) + ->needSubscriberPHIDs(false) + ->needProjectPHIDs(false); + $query->withPHIDs(array($object_phid)); + $task = $query->executeOne(); + if ($task->getStatus() === ManiphestTaskStatus::STATUS_CLOSED_DUPLICATE) { + $placeholder_text = 'This task is closed as a duplicate. '. + 'Comment here only if you think that this task is not a duplicate.'; + } + } + $remarkup_control = id(new PhabricatorRemarkupControl()) ->setViewer($viewer) ->setID($this->getCommentID()) ->addClass('phui-comment-fullwidth-control') ->addClass('phui-comment-textarea-control') ->setCanPin(true) + ->setPlaceholder($placeholder_text) ->setName('comment'); $draft_comment = '';