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:
parent
19b2c3d3d0
commit
ec57678f70
2 changed files with 12 additions and 0 deletions
|
@ -505,6 +505,10 @@ final class PhabricatorObjectHandleData {
|
||||||
$handle->setName($info['title']);
|
$handle->setName($info['title']);
|
||||||
$handle->setURI(PhrictionDocument::getSlugURI($info['slug']));
|
$handle->setURI(PhrictionDocument::getSlugURI($info['slug']));
|
||||||
$handle->setComplete(true);
|
$handle->setComplete(true);
|
||||||
|
if ($info['status'] != PhrictionDocumentStatus::STATUS_EXISTS) {
|
||||||
|
$closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
|
||||||
|
$handle->setStatus($closed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$handles[$phid] = $handle;
|
$handles[$phid] = $handle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,14 @@ final class PhrictionSearchIndexer
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_USER,
|
PhabricatorPHIDConstants::PHID_TYPE_USER,
|
||||||
$content->getDateCreated());
|
$content->getDateCreated());
|
||||||
|
|
||||||
|
if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {
|
||||||
|
$doc->addRelationship(
|
||||||
|
PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
||||||
|
$document->getPHID(),
|
||||||
|
PhabricatorPHIDConstants::PHID_TYPE_WIKI,
|
||||||
|
time());
|
||||||
|
}
|
||||||
|
|
||||||
return $doc;
|
return $doc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue