From a03d16907c03fb11c85f93d52ea4dd2cf5bc6a82 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Fri, 23 Jan 2015 11:32:38 -0800 Subject: [PATCH] Audit - fix issue "showing older" on some commits Summary: Fixes T7021. When I moved around all the timeline stuff I guess I didn't find this "corner" case, which is wildly common in the post-commit review workflow that we don't use. Test Plan: pre-patch I could reproduce the issue and post patch I could not. The reproduction case is to have a commit with inline comments and then enough subsequent comments to have a "show older" UI. clicking "show older" now works! Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7021 Differential Revision: https://secure.phabricator.com/D11479 --- .../controller/DiffusionCommitController.php | 23 ++----------------- .../storage/PhabricatorRepositoryCommit.php | 22 +++++++++++++++++- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 73b46511a8..70acf0e674 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -648,27 +648,8 @@ final class DiffusionCommitController extends DiffusionController { $timeline = $this->buildTransactionTimeline( $commit, new PhabricatorAuditTransactionQuery()); - $xactions = $timeline->getTransactions(); - - $path_ids = array(); - foreach ($xactions as $xaction) { - if ($xaction->hasComment()) { - $path_id = $xaction->getComment()->getPathID(); - if ($path_id) { - $path_ids[] = $path_id; - } - } - } - - $path_map = array(); - if ($path_ids) { - $path_map = id(new DiffusionPathQuery()) - ->withPathIDs($path_ids) - ->execute(); - $path_map = ipull($path_map, 'path', 'id'); - } - - return $timeline->setPathMap($path_map); + $commit->willRenderTimeline($timeline, $this->getRequest()); + return $timeline; } private function renderAddCommentPanel( diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php index 1acf43080c..cbc24afe0b 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php +++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php @@ -406,7 +406,27 @@ final class PhabricatorRepositoryCommit PhabricatorApplicationTransactionView $timeline, AphrontRequest $request) { - return $timeline; + $xactions = $timeline->getTransactions(); + + $path_ids = array(); + foreach ($xactions as $xaction) { + if ($xaction->hasComment()) { + $path_id = $xaction->getComment()->getPathID(); + if ($path_id) { + $path_ids[] = $path_id; + } + } + } + + $path_map = array(); + if ($path_ids) { + $path_map = id(new DiffusionPathQuery()) + ->withPathIDs($path_ids) + ->execute(); + $path_map = ipull($path_map, 'path', 'id'); + } + + return $timeline->setPathMap($path_map); } }