From 9eb36db1d7a164ba9a42442f86e57e49e59ddcf4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 28 Aug 2013 16:32:40 -0700 Subject: [PATCH] Hack-patch for missing highlights in Audit Summary: When I swapped the views, I accidentally removed some controller -> view -> controller logic which is used to figure out which packages are highlighted. This code is a mess, but fix the feature for now and we can clean it up later. Test Plan: {F56335} Reviewers: wez, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6835 --- .../controller/DiffusionCommitController.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 1db0302cc8..5af83f1d50 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -140,11 +140,21 @@ final class DiffusionCommitController extends DiffusionController { $content[] = $this->buildMergesTable($commit); + // TODO: This is silly, but the logic to figure out which audits are + // highlighted currently lives in PhabricatorAuditListView. Refactor this + // to be less goofy. + $highlighted_audits = id(new PhabricatorAuditListView()) + ->setAudits($audit_requests) + ->setAuthorityPHIDs($this->auditAuthorityPHIDs) + ->setUser($user) + ->setCommits(array($commit->getPHID() => $commit)) + ->getHighlightedAudits(); + $owners_paths = array(); - if ($this->highlightedAudits) { + if ($highlighted_audits) { $packages = id(new PhabricatorOwnersPackage())->loadAllWhere( 'phid IN (%Ls)', - mpull($this->highlightedAudits, 'getAuditorPHID')); + mpull($highlighted_audits, 'getAuditorPHID')); if ($packages) { $owners_paths = id(new PhabricatorOwnersPath())->loadAllWhere( 'repositoryPHID = %s AND packageID IN (%Ld)',