diff --git a/src/applications/differential/field/specification/reviewers/DifferentialReviewersFieldSpecification.php b/src/applications/differential/field/specification/reviewers/DifferentialReviewersFieldSpecification.php index 1d6546cd05..1117ade5cc 100644 --- a/src/applications/differential/field/specification/reviewers/DifferentialReviewersFieldSpecification.php +++ b/src/applications/differential/field/specification/reviewers/DifferentialReviewersFieldSpecification.php @@ -140,7 +140,7 @@ final class DifferentialReviewersFieldSpecification } public function renderValueForRevisionList(DifferentialRevision $revision) { - $primary_reviewer = $this->getPrimaryReviewer($revision); + $primary_reviewer = $revision->getPrimaryReviewer(); if ($primary_reviewer) { $other_reviewers = array_flip($revision->getReviewers()); unset($other_reviewers[$primary_reviewer]); @@ -157,19 +157,11 @@ final class DifferentialReviewersFieldSpecification public function getRequiredHandlePHIDsForRevisionList( DifferentialRevision $revision) { - $primary_reviewer = $this->getPrimaryReviewer($revision); + $primary_reviewer = $revision->getPrimaryReviewer(); if ($primary_reviewer) { return array($primary_reviewer); } return array(); } - private function getPrimaryReviewer(DifferentialRevision $revision) { - $primary_reviewer = $revision->getLastReviewerPHID(); - if (!$primary_reviewer) { - $primary_reviewer = head($revision->getReviewers()); - } - return $primary_reviewer; - } - } diff --git a/src/applications/differential/storage/revision/DifferentialRevision.php b/src/applications/differential/storage/revision/DifferentialRevision.php index 5e5303a30a..218470b656 100644 --- a/src/applications/differential/storage/revision/DifferentialRevision.php +++ b/src/applications/differential/storage/revision/DifferentialRevision.php @@ -206,6 +206,13 @@ final class DifferentialRevision extends DifferentialDAO { return array_keys($this->getUnsubscribed()); } + public function getPrimaryReviewer() { + if (!$this->lastReviewerPHID) { + return head($this->getReviewers()); + } + return $this->lastReviewerPHID; + } + public function loadReviewedBy() { $reviewer = null;