From 5cbc4fe7e1fcd7e81ef96b4fcfa74c17482786f4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 4 Oct 2012 15:31:04 -0700 Subject: [PATCH] Rename ManiphestTaskQuery::withProjects() to withAllProjects() Summary: After D3630, make the API more clear: withAllProjects() vs withAnyProjects() Test Plan: Loaded project page, maniphest task query, reports, filtered by project and "noproject". Grep. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1610 Differential Revision: https://secure.phabricator.com/D3631 --- .../method/maniphest/ConduitAPI_maniphest_query_Method.php | 2 +- src/applications/maniphest/ManiphestTaskQuery.php | 4 ++-- .../maniphest/controller/ManiphestReportController.php | 2 +- .../maniphest/controller/ManiphestTaskListController.php | 5 ++++- .../controller/PhabricatorProjectProfileController.php | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) 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)