Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14060161
D18033.id43373.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D18033.id43373.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 11:36 PM (21 h, 13 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6769622
Default Alt Text
D18033.id43373.diff (2 KB)
Attached To
Mode
D18033: Index Project milestones to accurately reflect milestone membership
Attached
Detach File
Event Timeline
Log In to Comment