summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Bug.pm
diff options
context:
space:
mode:
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 c639084ef..58405c2d0 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -349,6 +349,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 };
}
@@ -986,11 +998,6 @@ sub _bug_to_hash {
}
}
- 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',