mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
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
This commit is contained in:
parent
30eea5e936
commit
a03d16907c
2 changed files with 23 additions and 22 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue