1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Mark deleted Phriction pages as closed.

Summary:
This replaces D4042 and gives you the option to search for existing Phrication
documents only.

Test Plan:
# Reindexed ALL THE THINGS, saw existing documents show up in search in all cases.
# Deleted a document and saw it only show up when "Open and Closed Documents" are
shown.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4289
This commit is contained in:
Ricky Elrod 2012-12-26 17:10:29 -08:00 committed by epriestley
parent 19b2c3d3d0
commit ec57678f70
2 changed files with 12 additions and 0 deletions

View file

@ -505,6 +505,10 @@ final class PhabricatorObjectHandleData {
$handle->setName($info['title']);
$handle->setURI(PhrictionDocument::getSlugURI($info['slug']));
$handle->setComplete(true);
if ($info['status'] != PhrictionDocumentStatus::STATUS_EXISTS) {
$closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
$handle->setStatus($closed);
}
}
$handles[$phid] = $handle;
}

View file

@ -37,6 +37,14 @@ final class PhrictionSearchIndexer
PhabricatorPHIDConstants::PHID_TYPE_USER,
$content->getDateCreated());
if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {
$doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
$document->getPHID(),
PhabricatorPHIDConstants::PHID_TYPE_WIKI,
time());
}
return $doc;
}
}