@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix an incorrect filtering of groupless results from Maniphest "Group By" query

Summary:
Fixes T5081. This block enforces policies and prevents you from seeing groups associated with projects you can't see. However, it incorrectly removes tasks which end up with no group key. This can happen in two cases:

- The task isn't in a project.
- The task is in a project, but the query includes an "In All Projects: <that project>" constraint. In that case, we don't show the group becuase it would always contain every task.

Test Plan:
Replicated the setup in T5081, saw an "Ungrouped" group with "Task A":

{F155766}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5081

Differential Revision: https://secure.phabricator.com/D9152

+12 -1
+6
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 304 304 $projects = mpull($projects, null, 'getPHID'); 305 305 306 306 foreach ($tasks as $key => $task) { 307 + if (!$task->getGroupByProjectPHID()) { 308 + // This task is either not in any projects, or only in projects 309 + // which we're ignoring because they're being queried for explicitly. 310 + continue; 311 + } 312 + 307 313 if (empty($projects[$task->getGroupByProjectPHID()])) { 308 314 unset($tasks[$key]); 309 315 }
+6 -1
src/applications/maniphest/view/ManiphestTaskResultListView.php
··· 170 170 if ($label_key) { 171 171 return $handles[$label_key]->getFullName(); 172 172 } else { 173 - return pht('(No Project)'); 173 + // This may mean "No Projects", or it may mean the query has project 174 + // constraints but the task is only in constrained projects (in this 175 + // case, we don't show the group because it would always have all 176 + // of the tasks). Since distinguishing between these two cases is 177 + // messy and the UI is reasonably clear, label generically. 178 + return pht('(Ungrouped)'); 174 179 } 175 180 default: 176 181 return pht('Tasks');