1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Stop the debugging view for typeahead datasources from fataling

Summary: Fixes T13119. Ref T13120. This isn't the world's most elegant patch, but restores the debugging version of this view to service.

Test Plan: Viewed debugging phage (at `/typeahead/class/`). Used the actual proxy (by changing a datasource custom field from the comment area).

Maniphest Tasks: T13120, T13119

Differential Revision: https://secure.phabricator.com/D19304
This commit is contained in:
epriestley 2018-04-08 06:10:05 -07:00
parent fc103f71e9
commit af87f414e8

View file

@ -276,10 +276,20 @@ final class PhabricatorTypeaheadModularDatasourceController
// format to make it easier to debug typeahead output.
foreach ($sources as $key => $source) {
// See T13119. Exclude proxy datasources from the dropdown since they
// fatal if built like this without actually being configured with an
// underlying datasource. This is a bit hacky but this is just a
// debugging/development UI anyway.
if ($source instanceof PhabricatorTypeaheadProxyDatasource) {
unset($sources[$key]);
continue;
}
// This can happen with composite or generic sources.
if (!$source->getDatasourceApplicationClass()) {
continue;
}
if (!PhabricatorApplication::isClassInstalledForViewer(
$source->getDatasourceApplicationClass(),
$viewer)) {