mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-26 15:30:58 +01:00
Respect project closure states in fulltext search and handles
Summary: See thread; these are just bugs. Handles and main search do not mark projects correctly as open/closed. Test Plan: Searched for projects and observed they respect the open/closed flags properly after reidnexing. Reviewers: chad, btrahan Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D8237
This commit is contained in:
parent
23146f2bb9
commit
463552ade3
2 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue