1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Fix almanac.queryservices for no results

Summary: Ref T5833. We try to load bindings even if we get no services back.

Test Plan: Queried invalid results.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5833

Differential Revision: https://secure.phabricator.com/D10880
This commit is contained in:
epriestley 2014-11-19 15:19:49 -08:00
parent a414fc497f
commit 15ab2141da

View file

@ -52,11 +52,15 @@ final class AlmanacQueryServicesConduitAPIMethod
$services = $query->executeWithCursorPager($pager);
$bindings = id(new AlmanacBindingQuery())
->setViewer($viewer)
->withServicePHIDs(mpull($services, 'getPHID'))
->execute();
$bindings = mgroup($bindings, 'getServicePHID');
if ($services) {
$bindings = id(new AlmanacBindingQuery())
->setViewer($viewer)
->withServicePHIDs(mpull($services, 'getPHID'))
->execute();
$bindings = mgroup($bindings, 'getServicePHID');
} else {
$bindings = array();
}
$data = array();
foreach ($services as $service) {