diff --git a/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php b/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php index c4de156143..a03c3d7e48 100644 --- a/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php +++ b/src/applications/project/phid/PhabricatorProjectPHIDTypeProject.php @@ -42,6 +42,10 @@ final class PhabricatorProjectPHIDTypeProject extends PhabricatorPHIDType { $handle->setName($name); $handle->setObjectName('#'.rtrim($project->getPhrictionSlug(), '/')); $handle->setURI("/project/view/{$id}/"); + + if ($project->isArchived()) { + $handle->setStatus(PhabricatorObjectHandleStatus::STATUS_CLOSED); + } } } diff --git a/src/applications/project/search/PhabricatorProjectSearchIndexer.php b/src/applications/project/search/PhabricatorProjectSearchIndexer.php index faffced07a..ee29969f2d 100644 --- a/src/applications/project/search/PhabricatorProjectSearchIndexer.php +++ b/src/applications/project/search/PhabricatorProjectSearchIndexer.php @@ -20,6 +20,15 @@ final class PhabricatorProjectSearchIndexer $this->indexSubscribers($doc); $this->indexCustomFields($doc, $project); + $doc->addRelationship( + $project->isArchived() + ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED + : PhabricatorSearchRelationship::RELATIONSHIP_OPEN, + $project->getPHID(), + PhabricatorProjectPHIDTypeProject::TYPECONST, + time()); + + // NOTE: This could be more full-featured, but for now we're mostly // interested in the side effects of indexing.