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

Skip typeahead proxy data sources in the typeahead modular data source controller

Summary:
These data sources require another data source to function,
but PhabricatorTypeaheadModularDatasourceController does not support
specifying that. Treat them as non-existing, so that hapless callers
of requests to
/typeahead/class/PhabricatorCustomFieldApplicationSearchDatasource/
don't get confronted with a confusing error message.

Ref T16143

Test Plan:
* Visit http://phorge.localhost/typeahead/class/PhabricatorCustomFieldApplicationSearchDatasource/
and observe behaviour before and after applying this change. Previously
`Configured datasource class "" must be a valid subclass of "PhabricatorTypeaheadDatasource".` was
shown, now a regular 404 is visible.
* Go to http://phorge.localhost/maniphest/query/advanced/, see that typeahead proposals are still shown for any of the datasource fields, click magnifier button, "Browse" dialogs still come up and project can be selected, run a search and expected results are shown

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

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

Maniphest Tasks: T16143

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

mainframe98 fd9be992 2e86d7eb

+7
+7
src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
··· 36 36 if (isset($sources[$class])) { 37 37 $source = $sources[$class]; 38 38 39 + // PhabricatorTypeaheadProxyDatasource requires another data source 40 + // to function as it is merely a proxy. This controller does not 41 + // support setting the target data source. 42 + if ($source instanceof PhabricatorTypeaheadProxyDatasource) { 43 + return new Aphront404Response(); 44 + } 45 + 39 46 $parameters = array(); 40 47 41 48 $raw_parameters = $request->getStr('parameters');