Page MenuHomePhorge

Fix project typeahead query with columns when string is not name prefix
AcceptedPublic

Authored by aklapper on Thu, May 22, 10:10.

Details

Summary

Avoid an AphrontParameterQueryException when running a typeahead project name query with mustHaveColumns when the search string is not the prefix of the project name.
Since rP9a1d59ad5bd51ef4bf56533db260cc9e11a54fe6, Phorge runs queries in two phases: First prefix, then content, to sort project results accordingly.

PhabricatorTypeaheadDatasource::loadResultsForPhase() first goes for the prefix phase. This query may return zero results.
Current code does not correctly handle this situation.
Thus make the code smoothly skip to the content query phase and not run a PhabricatorProjectColumnQuery with an empty project PHID array parameter to end up in an exception.

Closes T16068

Test Plan
  • Have a parent project named Foo with a milestone named Sprint Chocolate Cake
  • Create a project workboard for that milestone named Sprint Chocolate Cake
  • In a project with no workboard yet, select "Import Columns" to end up on http://phorge.localhost/project/board/1/import/
  • See that typing the second string token (Chocolate) shows no autocomplete project proposals
  • Click the Magnifier button to Browse Projects
  • Start typing Chocolate and get an AphrontParameterQueryException
  • Apply the patch
  • See that typing the second string token (Chocolate) now shows autocomplete project proposals
  • Click the Magnifier button to Browse Projects
  • Start typing Chocolate and get project search results

Diff Detail

Repository
rP Phorge
Branch
T16068projQueryPhaseException (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2009
Build 2009: arc lint + arc unit