1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Fix dashboard list if there are no results

Summary:
We'll fire a bad query if there are no dashboards in the result list, see:

http://pastie.org/private/j0f8tzbdahwragxjsk8qxq

Test Plan: Viewed result list with no dashboards.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10207
This commit is contained in:
epriestley 2014-08-09 19:08:16 -07:00
parent 0e98e33b33
commit c0919be0ec

View file

@ -55,13 +55,18 @@ final class PhabricatorDashboardSearchEngine
$dashboards = mpull($dashboards, null, 'getPHID');
$viewer = $this->requireViewer();
$installs = id(new PhabricatorDashboardInstall())
->loadAllWhere(
'objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)',
array(PhabricatorHomeApplication::DASHBOARD_DEFAULT,
$viewer->getPHID()),
array_keys($dashboards));
$installs = mpull($installs, null, 'getDashboardPHID');
if ($dashboards) {
$installs = id(new PhabricatorDashboardInstall())
->loadAllWhere(
'objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)',
array(PhabricatorHomeApplication::DASHBOARD_DEFAULT,
$viewer->getPHID()),
array_keys($dashboards));
$installs = mpull($installs, null, 'getDashboardPHID');
} else {
$installs = array();
}
$list = new PHUIObjectItemListView();
$list->setUser($viewer);