summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 0956ddd8d..fa66edb80 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -24,6 +24,7 @@ package Bugzilla::WebService::Bug;
use strict;
use base qw(Bugzilla::WebService);
+use feature 'state';
use Bugzilla::Comment;
use Bugzilla::Comment::TagWeights;
@@ -1322,6 +1323,11 @@ sub _bug_to_hash {
whiteboard => $self->type('string', $bug->status_whiteboard),
} };
+ state $voting_enabled //= $bug->can('votes') ? 1 : 0;
+ if ($voting_enabled && filter_wants $params, 'votes') {
+ $item{votes} = $self->type('int', $bug->votes);
+ }
+
# First we handle any fields that require extra work (such as date parsing
# or SQL calls).
if (filter_wants $params, 'assigned_to') {