Why do Milestones in parent project's Workboard seemingly randomly hide tasks?
Event Timeline
I can’t think of a reason this would be happening other than a bug or database inconsistency.
The expected behavior is kind of complicated:
Hi @20after4.
I patched this in our local repo with a change to /src/applications/project/engine/PhabricatorBoardLayoutEngine.php, in the layoutBoard() method. Around line 520, inside if ($proxy_hits) block, you have array_slice() taking the first element of $proxy_hits, which seems random.
So, I just added some logic to check if any of the $proxy_hits are Milestones, and if so, use the first Milestone element. Else default to the existing logic.
So unless there actually is something significant about the 1st element in $proxy_hits - if it is actually random - this wouldn't break anything. Just adds some selectivity. And it fixed our issue of invisible Milestones tasks in Project Workboards.
Do you think I should submit the diff?
Before:
if ($proxy_hits) { // TODO: For now, only one column hit is permissible. $proxy_hits = array_slice($proxy_hits, 0, 1); $proxy_hits = array_fuse($proxy_hits);
After:
if ($proxy_hits) { // TODO: For now, only one column hit is permissible. if (count($proxy_hits) > 1) { // prefer milestone column because otherwise milestone tasks // are inconsistently displayed $milestones = array_filter($proxy_hits, function ($key) use ($columns) { return isset($columns[$key]) && $columns[$key]->getDisplayClass() === 'phui-workboard-column-milestone'; }); $first = !empty($milestones) ? reset($milestones) : reset($proxy_hits); $proxy_hits = [$first]; } $proxy_hits = array_fuse($proxy_hits);