mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12:41 +01:00
Phriction - sever remaining project ties
Summary: 'cuz the wiki don't play that no more. Fixes T6497. This is mainly important to fix an incorrect policy filtering issue where a project policy can incorrectly override a document policy. Otherwise, it makes things nice and clean. Test Plan: - viewed the wiki - success. - viewed wiki document list under "index" and tried a few different queries - grep'd for things like "hasProject" and "getProject" and saw no phriction-related results Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6497 Differential Revision: https://secure.phabricator.com/D10818
This commit is contained in:
parent
bcd78716df
commit
b655699a6c
3 changed files with 0 additions and 54 deletions
|
@ -155,38 +155,6 @@ final class PhrictionDocumentQuery
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($documents as $document) {
|
||||
$document->attachProject(null);
|
||||
}
|
||||
|
||||
$project_slugs = array();
|
||||
foreach ($documents as $key => $document) {
|
||||
$slug = $document->getSlug();
|
||||
if (!PhrictionDocument::isProjectSlug($slug)) {
|
||||
continue;
|
||||
}
|
||||
$project_slugs[$key] = PhrictionDocument::getProjectSlugIdentifier($slug);
|
||||
}
|
||||
|
||||
if ($project_slugs) {
|
||||
$projects = id(new PhabricatorProjectQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withPhrictionSlugs($project_slugs)
|
||||
->execute();
|
||||
$projects = mpull($projects, null, 'getPhrictionSlug');
|
||||
foreach ($documents as $key => $document) {
|
||||
$slug = idx($project_slugs, $key);
|
||||
if ($slug) {
|
||||
$project = idx($projects, $slug);
|
||||
if (!$project) {
|
||||
unset($documents[$key]);
|
||||
continue;
|
||||
}
|
||||
$document->attachProject($project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $documents;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,9 +121,6 @@ final class PhrictionSearchEngine
|
|||
$phids = array();
|
||||
foreach ($documents as $document) {
|
||||
$content = $document->getContent();
|
||||
if ($document->hasProject()) {
|
||||
$phids[] = $document->getProject()->getPHID();
|
||||
}
|
||||
$phids[] = $content->getAuthorPHID();
|
||||
}
|
||||
|
||||
|
@ -161,11 +158,6 @@ final class PhrictionSearchEngine
|
|||
->addByline($byline)
|
||||
->addIcon('none', $updated);
|
||||
|
||||
if ($document->hasProject()) {
|
||||
$item->addAttribute(
|
||||
$handles[$document->getProject()->getPHID()]->renderLink());
|
||||
}
|
||||
|
||||
$item->addAttribute($slug_uri);
|
||||
|
||||
switch ($document->getStatus()) {
|
||||
|
|
|
@ -18,7 +18,6 @@ final class PhrictionDocument extends PhrictionDAO
|
|||
|
||||
private $contentObject = self::ATTACHABLE;
|
||||
private $ancestors = array();
|
||||
private $project = self::ATTACHABLE;
|
||||
|
||||
public function getConfiguration() {
|
||||
return array(
|
||||
|
@ -132,19 +131,6 @@ final class PhrictionDocument extends PhrictionDAO
|
|||
return $this->assertAttached($this->contentObject);
|
||||
}
|
||||
|
||||
public function getProject() {
|
||||
return $this->assertAttached($this->project);
|
||||
}
|
||||
|
||||
public function attachProject(PhabricatorProject $project = null) {
|
||||
$this->project = $project;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasProject() {
|
||||
return (bool)$this->getProject();
|
||||
}
|
||||
|
||||
public function getAncestors() {
|
||||
return $this->ancestors;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue