From c57791dc825c0393c27b3ca3656d69f7253b86b7 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 6 Aug 2014 20:24:22 +0000 Subject: Bug 1049830: Bug.search with count_only = 1 does not work for JSONRPC and REST but does work for XMLRPC --- Bugzilla/WebService/Bug.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 5ce098e74..405f04b0f 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -596,7 +596,14 @@ sub search { my ($data) = $search->data; # BMO if the caller only wants the count, that's all we need to return - return $data if $params->{count_only}; + if ($params->{count_only}) { + if (Bugzilla->usage_mode == USAGE_MODE_XMLRPC) { + return $data; + } + else { + return { bug_count => $data }; + } + } if (!scalar @$data) { return { bugs => [] }; -- cgit v1.2.3-24-g4f1b