From c0919be0ecbd8c7d95e08da9e4207394d0bceaee Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 9 Aug 2014 19:08:16 -0700 Subject: [PATCH] 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 --- .../PhabricatorDashboardSearchEngine.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php index 8d76cadcec..1fdc7b9016 100644 --- a/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php +++ b/src/applications/dashboard/query/PhabricatorDashboardSearchEngine.php @@ -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);