@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.

Allow "O42" to find packages by monogram in Owners typeaheads

Summary: When a user queries by package monogram explicitly, search by package ID.

Test Plan: {F2305075}

Reviewers: chad

Reviewed By: chad

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

+10 -1
+10 -1
src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php
··· 22 22 $results = array(); 23 23 24 24 $query = id(new PhabricatorOwnersPackageQuery()) 25 - ->withNameNgrams($raw_query) 26 25 ->setOrder('name'); 26 + 27 + // If the user is querying by monogram explicitly, like "O123", do an ID 28 + // search. Otherwise, do an ngram substring search. 29 + if (preg_match('/^[oO]\d+\z/', $raw_query)) { 30 + $id = trim($raw_query, 'oO'); 31 + $id = (int)$id; 32 + $query->withIDs(array($id)); 33 + } else { 34 + $query->withNameNgrams($raw_query); 35 + } 27 36 28 37 $packages = $this->executeQuery($query); 29 38 foreach ($packages as $package) {