@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 issue where tokenizers can sort milestone results into the wrong query phase

Summary:
Fixes T11955. Currently, milestones have an internal name of "Parent (Milestone) ...".

This makes them look like they're prefix matches for "Parent", but they're actually prefix matches for "Milestone".

Reorder the names so that the internal name is "Milestone Parent ...".

Test Plan: Created a project "AAA" with milestone "BBB". Searched for "AAA", found "AAA" and milestone "AAA (BBB)".

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11955

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

+12 -1
+12 -1
src/applications/project/typeahead/PhabricatorProjectDatasource.php
··· 102 102 } 103 103 104 104 $all_strings = array(); 105 - $all_strings[] = $proj->getDisplayName(); 105 + 106 + // NOTE: We list the project's name first because results will be 107 + // sorted into prefix vs content phases incorrectly if we don't: it 108 + // will look like "Parent (Milestone)" matched "Parent" as a prefix, 109 + // but it did not. 110 + $all_strings[] = $proj->getName(); 111 + 112 + if ($proj->isMilestone()) { 113 + $all_strings[] = $proj->getParentProject()->getName(); 114 + } 115 + 106 116 foreach ($proj->getSlugs() as $project_slug) { 107 117 $all_strings[] = $project_slug->getSlug(); 108 118 } 119 + 109 120 $all_strings = implode("\n", $all_strings); 110 121 111 122 $proj_result = id(new PhabricatorTypeaheadResult())