summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-06-17 06:26:09 +0200
committerSimon Green <sgreen@redhat.com>2013-06-17 06:26:09 +0200
commit1ed42e893a83ccaf56e522a4b5391926c0a96303 (patch)
treef9c50481d1ffc85d5b5eee0cbb952f7d8f68b277
parent7ac0c72189843239a91ddbb1de55868cbe00845f (diff)
downloadbugzilla-1ed42e893a83ccaf56e522a4b5391926c0a96303.tar.gz
bugzilla-1ed42e893a83ccaf56e522a4b5391926c0a96303.tar.xz
Bug 880097 - Only retrieve database fetched values if requested
r=glob, a=LpSolit
-rw-r--r--Bugzilla/WebService/Bug.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index ff6a85582..5522af2bd 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -868,8 +868,6 @@ sub _bug_to_hash {
# database call to get the info.
my %item = (
alias => $self->type('string', $bug->alias),
- classification => $self->type('string', $bug->classification),
- component => $self->type('string', $bug->component),
creation_time => $self->type('dateTime', $bug->creation_ts),
# No need to format $bug->deadline specially, because Bugzilla::Bug
# already does it for us.
@@ -880,7 +878,6 @@ sub _bug_to_hash {
op_sys => $self->type('string', $bug->op_sys),
platform => $self->type('string', $bug->rep_platform),
priority => $self->type('string', $bug->priority),
- product => $self->type('string', $bug->product),
resolution => $self->type('string', $bug->resolution),
severity => $self->type('string', $bug->bug_severity),
status => $self->type('string', $bug->bug_status),
@@ -902,6 +899,12 @@ sub _bug_to_hash {
my @blocks = map { $self->type('int', $_) } @{ $bug->blocked };
$item{'blocks'} = \@blocks;
}
+ if (filter_wants $params, 'classification') {
+ $item{classification} = $self->type('string', $bug->classification);
+ }
+ if (filter_wants $params, 'component') {
+ $item{component} = $self->type('string', $bug->component);
+ }
if (filter_wants $params, 'cc') {
my @cc = map { $self->type('email', $_) } @{ $bug->cc };
$item{'cc'} = \@cc;
@@ -929,6 +932,9 @@ sub _bug_to_hash {
@{ $bug->keyword_objects };
$item{'keywords'} = \@keywords;
}
+ if (filter_wants $params, 'product') {
+ $item{product} = $self->type('string', $bug->product);
+ }
if (filter_wants $params, 'qa_contact') {
my $qa_login = $bug->qa_contact ? $bug->qa_contact->login : '';
$item{'qa_contact'} = $self->type('email', $qa_login);
@@ -968,7 +974,10 @@ sub _bug_to_hash {
if (Bugzilla->user->is_timetracker) {
$item{'estimated_time'} = $self->type('double', $bug->estimated_time);
$item{'remaining_time'} = $self->type('double', $bug->remaining_time);
- $item{'actual_time'} = $self->type('double', $bug->actual_time);
+
+ if (filter_wants $params, 'actual_time') {
+ $item{'actual_time'} = $self->type('double', $bug->actual_time);
+ }
}
if (Bugzilla->user->id) {