diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php index 45125c28b0..ed2a2189a6 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php @@ -130,7 +130,10 @@ final class PhabricatorPeopleProfileViewController ->setViewer($viewer) ->withMemberPHIDs(array($user->getPHID())) ->needImages(true) - ->withStatus(PhabricatorProjectQuery::STATUS_OPEN) + ->withStatuses( + array( + PhabricatorProjectStatus::STATUS_ACTIVE, + )) ->execute(); $header = id(new PHUIHeaderView()) diff --git a/src/applications/policy/query/PhabricatorPolicyQuery.php b/src/applications/policy/query/PhabricatorPolicyQuery.php index df1d6fb0b8..e6e7008827 100644 --- a/src/applications/policy/query/PhabricatorPolicyQuery.php +++ b/src/applications/policy/query/PhabricatorPolicyQuery.php @@ -230,6 +230,10 @@ final class PhabricatorPolicyQuery ->setViewer($viewer) ->withMemberPHIDs(array($viewer->getPHID())) ->withIsMilestone(false) + ->withStatuses( + array( + PhabricatorProjectStatus::STATUS_ACTIVE, + )) ->setLimit($default_limit) ->execute(); $default_projects = mpull($default_projects, null, 'getPHID'); diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php index 304dd956e1..f4711bb4f7 100644 --- a/src/applications/project/query/PhabricatorProjectQuery.php +++ b/src/applications/project/query/PhabricatorProjectQuery.php @@ -27,6 +27,7 @@ final class PhabricatorProjectQuery const STATUS_CLOSED = 'status-closed'; const STATUS_ACTIVE = 'status-active'; const STATUS_ARCHIVED = 'status-archived'; + private $statuses; private $needSlugs; private $needMembers; @@ -49,6 +50,11 @@ final class PhabricatorProjectQuery return $this; } + public function withStatuses(array $statuses) { + $this->statuses = $statuses; + return $this; + } + public function withMemberPHIDs(array $member_phids) { $this->memberPHIDs = $member_phids; return $this; @@ -387,6 +393,13 @@ final class PhabricatorProjectQuery $filter); } + if ($this->statuses !== null) { + $where[] = qsprintf( + $conn, + 'status IN (%Ls)', + $this->statuses); + } + if ($this->ids !== null) { $where[] = qsprintf( $conn,