From 8fbe6347d22d4208c81dd24ac1c2d4c5b6482b05 Mon Sep 17 00:00:00 2001 From: Alan Huang Date: Wed, 8 Aug 2012 13:27:52 -0700 Subject: [PATCH] Load primary reviewer PHID Summary: A cursory look at DifferentialReviewer suggests the primary reviewer doesn't actually have to be among the reviewers? Uploading this so bug reporter can patch and see if it helps. Test Plan: Nope. Reviewers: epriestley Reviewed By: epriestley CC: szymon, aran, Korvin Maniphest Tasks: T1625 Differential Revision: https://secure.phabricator.com/D3198 --- .../differential/storage/DifferentialRevision.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 7e39fed499..91b2594406 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -283,10 +283,12 @@ final class DifferentialRevision extends DifferentialDAO { } public function getPrimaryReviewer() { - if (!$this->lastReviewerPHID) { + $reviewers = $this->getReviewers(); + $last = $this->lastReviewerPHID; + if (!$last || !in_array($last, $reviewers)) { return head($this->getReviewers()); } - return $this->lastReviewerPHID; + return $last; } public function loadReviewedBy() {