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

Do not propose Owners or Packages as Subscribers when uninstalled

Summary:
After creating Owners and Packages and then uninstalling the Owners and Packages applications, PhabricatorMetaMTAMailableFunctionDatasource proposals (for example when using typeahead in the "Subscribers" field on http://phorge.localhost/maniphest/query/advanced/) still propose results for these applications, plus the field placeholder text still mentions packages. I consider this unwanted and confusing behavior.

Closes T16149

Test Plan:
1. Go to http://phorge.localhost/applications/view/PhabricatorPackagesApplication/ and make sure that "Packages" prototype application is installed
2. Go to http://phorge.localhost/applications/view/PhabricatorOwnersApplication/ and make sure that "Owners" application is installed
3. Go to http://phorge.localhost/people/new/standard/ and create a Standard User called "TestPackageOwner"
4. Go to http://phorge.localhost/owners/edit/form/default/ and create a package named "TestPackageOwnerPackage" with the "Owner" set to "TestPackageOwner" (of course this is different from using http://phorge.localhost/packages/package/edit/1/ to create a package, God knows)
5. See that package also listed on http://phorge.localhost/owners/query/all/ as "Ox" (totally unneeded step I guess)
6. Go to http://phorge.localhost/maniphest/query/advanced/ and look at the placeholder text for the "Subscribers" field: `'Type a username, project, mailing list, package, or function...'`
7. In the "Subscribers" field, start typing the characters "TestPackageOwner"
8. In the "Subscribers" field dropdown, get the user and also "* Packages: TestPackageOwner" proposed
9. Go to http://phorge.localhost/applications/view/PhabricatorPackagesApplication/ and uninstall the "Packages" prototype application
10. Go to http://phorge.localhost/applications/view/PhabricatorOwnersApplication/ and uninstall the "Owners" application
11. Reload / go to http://phorge.localhost/maniphest/query/advanced/
12. Check the placeholder text for the "Subscribers" field
13. Start typing "TestPackageOwner" in the "Subscribers" field and check whether the dropdown proposals include "* Packages: TestPackageOwner" and/or "O1: TestPackageOwnerPackage"
14. Repeat steps 11 to 13 after (un)installing the Packages and/or Owners applications

Reviewers: O1 Blessed Committers, valerio.bozzolan, mainframe98

Reviewed By: O1 Blessed Committers, valerio.bozzolan, mainframe98

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16149

Differential Revision: https://we.phorge.it/D26140

+9 -2
+8 -2
src/applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php
··· 8 8 } 9 9 10 10 public function getPlaceholderText() { 11 - return pht( 12 - 'Type a username, project, mailing list, package, or function...'); 11 + if (id(new PhabricatorOwnersApplication())->isInstalled() || 12 + id(new PhabricatorPackagesApplication())->isInstalled()) { 13 + return pht( 14 + 'Type a username, project, mailing list, package, or function...'); 15 + } else { 16 + return pht( 17 + 'Type a username, project, mailing list, or function...'); 18 + } 13 19 } 14 20 15 21 public function getDatasourceApplicationClass() {
+1
src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php
··· 246 246 $result = id(new PhabricatorApplicationQuery()) 247 247 ->setViewer($this->getViewer()) 248 248 ->withClasses(array($application_class)) 249 + ->withInstalled(true) 249 250 ->execute(); 250 251 if (!$result) { 251 252 continue;