mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
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
This commit is contained in:
parent
5a95efaa4b
commit
9c38b61e51
1 changed files with 12 additions and 1 deletions
|
@ -102,10 +102,21 @@ final class PhabricatorProjectDatasource
|
|||
}
|
||||
|
||||
$all_strings = array();
|
||||
$all_strings[] = $proj->getDisplayName();
|
||||
|
||||
// NOTE: We list the project's name first because results will be
|
||||
// sorted into prefix vs content phases incorrectly if we don't: it
|
||||
// will look like "Parent (Milestone)" matched "Parent" as a prefix,
|
||||
// but it did not.
|
||||
$all_strings[] = $proj->getName();
|
||||
|
||||
if ($proj->isMilestone()) {
|
||||
$all_strings[] = $proj->getParentProject()->getName();
|
||||
}
|
||||
|
||||
foreach ($proj->getSlugs() as $project_slug) {
|
||||
$all_strings[] = $project_slug->getSlug();
|
||||
}
|
||||
|
||||
$all_strings = implode("\n", $all_strings);
|
||||
|
||||
$proj_result = id(new PhabricatorTypeaheadResult())
|
||||
|
|
Loading…
Reference in a new issue