summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Bug.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-08-09 19:55:53 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-08-09 19:55:53 +0200
commit460ae51fc0e70dd2d7fcef4bdb92308269327f1d (patch)
tree4d9eb74d49ec5fcdfb362345c5667c400c2cc2ea /Bugzilla/WebService/Bug.pm
parentdbc5625130931706a14de0bb88ecc5d1d2bdf3fb (diff)
downloadbugzilla-460ae51fc0e70dd2d7fcef4bdb92308269327f1d.tar.gz
bugzilla-460ae51fc0e70dd2d7fcef4bdb92308269327f1d.tar.xz
Bug 903514 - Backport upstream bug 569177 for etag support to bmo/4.2
Diffstat (limited to 'Bugzilla/WebService/Bug.pm')
-rw-r--r--Bugzilla/WebService/Bug.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index a07196209..df9084210 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -350,6 +350,18 @@ sub get {
push(@bugs, $self->_bug_to_hash($bug, $params));
}
+ # Set the ETag before inserting the update tokens
+ # since the tokens will always be unique even if
+ # the data has not changed.
+ $self->bz_etag(\@bugs);
+
+ if (Bugzilla->user->id) {
+ foreach my $bug (@bugs) {
+ my $token = issue_hash_token([$bug->{'id'}, $bug->{'last_change_time'}]);
+ $bug->{'update_token'} = $self->type('string', $token);
+ }
+ }
+
return { bugs => \@bugs, faults => \@faults };
}
@@ -1008,11 +1020,6 @@ sub _bug_to_hash {
$item{'actual_time'} = $self->type('double', $bug->actual_time);
}
- if (Bugzilla->user->id) {
- my $token = issue_hash_token([$bug->id, $bug->delta_ts]);
- $item{'update_token'} = $self->type('string', $token);
- }
-
# The "accessible" bits go here because they have long names and it
# makes the code look nicer to separate them out.
$item{'is_cc_accessible'} = $self->type('boolean',