From 076f342aed6b54939d24e67938723d77d212e3cf Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 9 Feb 2011 14:28:16 -0800 Subject: [PATCH] Fix an issue with comment group aggregation. Summary: Test Plan: Reviewers: CC: --- .../ManiphestTransactionDetailView.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/applications/maniphest/view/transactiondetail/ManiphestTransactionDetailView.php b/src/applications/maniphest/view/transactiondetail/ManiphestTransactionDetailView.php index 1ffc2ecb36..8af452ebdf 100644 --- a/src/applications/maniphest/view/transactiondetail/ManiphestTransactionDetailView.php +++ b/src/applications/maniphest/view/transactiondetail/ManiphestTransactionDetailView.php @@ -78,23 +78,16 @@ class ManiphestTransactionDetailView extends AphrontView { require_celerity_resource('maniphest-transaction-detail-css'); + $comment_transaction = null; foreach ($this->transactions as $transaction) { if ($transaction->hasComments()) { + $comment_transaction = $transaction; break; } } + $any_transaction = reset($transactions); - $author = $this->handles[$transaction->getAuthorPHID()]; - - $comments = $transaction->getCache(); - if (!strlen($comments)) { - $comments = $transaction->getComments(); - if (strlen($comments)) { - $comments = $this->markupEngine->markupText($comments); - $transaction->setCache($comments); - $transaction->save(); - } - } + $author = $this->handles[$any_transaction->getAuthorPHID()]; $more_classes = array(); $descs = array(); @@ -107,7 +100,14 @@ class ManiphestTransactionDetailView extends AphrontView { $more_classes = implode(' ', $classes); - if ($transaction->hasComments()) { + if ($comment_transaction && $comment_transaction->hasComments()) { + $comments = $comment_transaction->getCache(); + if (!strlen($comments)) { + $comments = $comment_transaction->getComments(); + $comments = $this->markupEngine->markupText($comments); + $transaction->setCache($comments); + $transaction->save(); + } $comment_block = '
'. $comments.