diff --git a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php index dfabfab9c5..73ce3ae55d 100644 --- a/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php +++ b/src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php @@ -91,7 +91,7 @@ class ConduitAPI_maniphest_query_Method $projects = $request->getValue('projectPHIDs'); if ($projects) { - $query->withProjects($projects); + $query->withAllProjects($projects); } $ccs = $request->getValue('ccPHIDs'); diff --git a/src/applications/maniphest/ManiphestTaskQuery.php b/src/applications/maniphest/ManiphestTaskQuery.php index ab66578a12..5f8fcbbcdd 100644 --- a/src/applications/maniphest/ManiphestTaskQuery.php +++ b/src/applications/maniphest/ManiphestTaskQuery.php @@ -98,7 +98,7 @@ final class ManiphestTaskQuery extends PhabricatorQuery { return $this; } - public function withProjects(array $projects) { + public function withAllProjects(array $projects) { $this->includeNoProject = false; foreach ($projects as $k => $phid) { if ($phid == ManiphestTaskOwner::PROJECT_NO_PROJECT) { @@ -472,7 +472,7 @@ final class ManiphestTaskQuery extends PhabricatorQuery { $project_dao = new ManiphestTaskProject(); return qsprintf( $conn, - 'LEFT JOIN %T anyproject ON anyproject.taskPHID = task.phid', + 'JOIN %T anyproject ON anyproject.taskPHID = task.phid', $project_dao->getTableName()); } diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index e3f61077cc..9d0098e1ca 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -406,7 +406,7 @@ final class ManiphestReportController extends ManiphestController { $handles = $this->loadViewerHandles($phids); $project_handle = $handles[$project_phid]; - $query->withProjects($phids); + $query->withAnyProjects($phids); } $tasks = $query->execute(); diff --git a/src/applications/maniphest/controller/ManiphestTaskListController.php b/src/applications/maniphest/controller/ManiphestTaskListController.php index 6f0fbc55cc..3c8baf0da3 100644 --- a/src/applications/maniphest/controller/ManiphestTaskListController.php +++ b/src/applications/maniphest/controller/ManiphestTaskListController.php @@ -425,9 +425,12 @@ final class ManiphestTaskListController extends ManiphestController { ManiphestTaskPriority::getHighestPriority()); $query = new ManiphestTaskQuery(); - $query->withProjects($project_phids); $query->withTaskIDs($task_ids); + if ($project_phids) { + $query->withAllProjects($project_phids); + } + if ($xproject_phids) { $query->withoutProjects($xproject_phids); } diff --git a/src/applications/project/controller/PhabricatorProjectProfileController.php b/src/applications/project/controller/PhabricatorProjectProfileController.php index 637eaeb04b..8cff6d26e5 100644 --- a/src/applications/project/controller/PhabricatorProjectProfileController.php +++ b/src/applications/project/controller/PhabricatorProjectProfileController.php @@ -247,7 +247,7 @@ final class PhabricatorProjectProfileController PhabricatorProjectProfile $profile) { $query = id(new ManiphestTaskQuery()) - ->withProjects(array($project->getPHID())) + ->withAnyProjects(array($project->getPHID())) ->withStatus(ManiphestTaskQuery::STATUS_OPEN) ->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY) ->setLimit(10)