diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 536e213bde..9c9a6c1a77 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -262,11 +262,19 @@ final class DifferentialRevisionViewController extends DifferentialController { $revision, $changesets); + $wrap_id = celerity_generate_unique_node_id(); + $comment_view = phutil_tag( + 'div', + array( + 'id' => $wrap_id, + ), + $comment_view); + if ($arc_project) { Javelin::initBehavior( 'repository-crossreference', array( - 'section' => $comment_view->getID(), + 'section' => $wrap_id, 'projects' => $project_phids, )); } diff --git a/src/applications/differential/view/DifferentialTransactionView.php b/src/applications/differential/view/DifferentialTransactionView.php index 9bec0e5fa5..23ef06f637 100644 --- a/src/applications/differential/view/DifferentialTransactionView.php +++ b/src/applications/differential/view/DifferentialTransactionView.php @@ -96,7 +96,17 @@ final class DifferentialTransactionView array_keys($changesets)); foreach ($inline_groups as $changeset_id => $group) { - $group = msort($group, 'getLineNumber'); + // Sort the group of inlines by line number. + $by_line = array(); + foreach ($group as $inline) { + $by_line[] = array( + 'line' => $inline->getComment()->getLineNumber().','. + $inline->getComment()->getLineLength(), + 'inline' => $inline, + ); + } + $by_line = isort($by_line, 'line'); + $group = ipull($by_line, 'inline'); $changeset = $changesets[$changeset_id]; $items = array();