Page MenuHomePhabricator

D18033.diff
No OneTemporary

D18033.diff

diff --git a/resources/sql/autopatches/20170526.milestones.php b/resources/sql/autopatches/20170526.milestones.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170526.milestones.php
@@ -0,0 +1,11 @@
+<?php
+
+$table = new PhabricatorProject();
+
+foreach (new LiskMigrationIterator($table) as $project) {
+ PhabricatorSearchWorker::queueDocumentForIndexing(
+ $project->getPHID(),
+ array(
+ 'force' => true,
+ ));
+}
diff --git a/src/applications/project/engineextension/PhabricatorProjectsMembershipIndexEngineExtension.php b/src/applications/project/engineextension/PhabricatorProjectsMembershipIndexEngineExtension.php
--- a/src/applications/project/engineextension/PhabricatorProjectsMembershipIndexEngineExtension.php
+++ b/src/applications/project/engineextension/PhabricatorProjectsMembershipIndexEngineExtension.php
@@ -34,29 +34,30 @@
}
private function materializeProject(PhabricatorProject $project) {
- if ($project->isMilestone()) {
- return;
- }
-
$material_type = PhabricatorProjectMaterializedMemberEdgeType::EDGECONST;
$member_type = PhabricatorProjectProjectHasMemberEdgeType::EDGECONST;
$project_phid = $project->getPHID();
- $descendants = id(new PhabricatorProjectQuery())
- ->setViewer($this->getViewer())
- ->withAncestorProjectPHIDs(array($project->getPHID()))
- ->withIsMilestone(false)
- ->withHasSubprojects(false)
- ->execute();
- $descendant_phids = mpull($descendants, 'getPHID');
-
- if ($descendant_phids) {
- $source_phids = $descendant_phids;
- $has_subprojects = true;
- } else {
- $source_phids = array($project->getPHID());
+ if ($project->isMilestone()) {
+ $source_phids = array($project->getParentProjectPHID());
$has_subprojects = false;
+ } else {
+ $descendants = id(new PhabricatorProjectQuery())
+ ->setViewer($this->getViewer())
+ ->withAncestorProjectPHIDs(array($project->getPHID()))
+ ->withIsMilestone(false)
+ ->withHasSubprojects(false)
+ ->execute();
+ $descendant_phids = mpull($descendants, 'getPHID');
+
+ if ($descendant_phids) {
+ $source_phids = $descendant_phids;
+ $has_subprojects = true;
+ } else {
+ $source_phids = array($project->getPHID());
+ $has_subprojects = false;
+ }
}
$conn_w = $project->establishConnection('w');

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 3:34 PM (12 h, 39 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6769622
Default Alt Text
D18033.diff (2 KB)

Event Timeline