diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php --- a/src/applications/maniphest/query/ManiphestTaskQuery.php +++ b/src/applications/maniphest/query/ManiphestTaskQuery.php @@ -304,6 +304,12 @@ $projects = mpull($projects, null, 'getPHID'); foreach ($tasks as $key => $task) { + if (!$task->getGroupByProjectPHID()) { + // This task is either not in any projects, or only in projects + // which we're ignoring because they're being queried for explicitly. + continue; + } + if (empty($projects[$task->getGroupByProjectPHID()])) { unset($tasks[$key]); } diff --git a/src/applications/maniphest/view/ManiphestTaskResultListView.php b/src/applications/maniphest/view/ManiphestTaskResultListView.php --- a/src/applications/maniphest/view/ManiphestTaskResultListView.php +++ b/src/applications/maniphest/view/ManiphestTaskResultListView.php @@ -170,7 +170,12 @@ if ($label_key) { return $handles[$label_key]->getFullName(); } else { - return pht('(No Project)'); + // This may mean "No Projects", or it may mean the query has project + // constraints but the task is only in constrained projects (in this + // case, we don't show the group because it would always have all + // of the tasks). Since distinguishing between these two cases is + // messy and the UI is reasonably clear, label generically. + return pht('(Ungrouped)'); } default: return pht('Tasks');