summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-06-18 06:08:17 +0200
committerByron Jones <glob@mozilla.com>2014-06-18 06:08:30 +0200
commitd83e1befce44ae92c0e26c6dfa47a4d3326b0632 (patch)
tree3a4e122e480f3e7d59a24874b7b9ad18b4f9f930 /extensions
parent324f00d76a2f33421c047d4e86a17bb6fa34b416 (diff)
downloadbugzilla-d83e1befce44ae92c0e26c6dfa47a4d3326b0632.tar.gz
bugzilla-d83e1befce44ae92c0e26c6dfa47a4d3326b0632.tar.xz
Bug 1026400: id, attachment.id, attachment.bug_id are returned as strings, not integers
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BzAPI/lib/Util.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/extensions/BzAPI/lib/Util.pm b/extensions/BzAPI/lib/Util.pm
index e25e75b55..6446792a0 100644
--- a/extensions/BzAPI/lib/Util.pm
+++ b/extensions/BzAPI/lib/Util.pm
@@ -120,7 +120,7 @@ sub fix_bug {
my $attachments = $rpc->attachments($attachment_params);
my @fixed_attachments;
- foreach my $attachment (@{ $attachments->{bugs}->{$data->{id}} }) {
+ foreach my $attachment (@{ $attachments->{bugs}->{$bug->id} }) {
my $fixed = fix_attachment($attachment);
push(@fixed_attachments, filter($params, $fixed, undef, 'attachments'));
}
@@ -265,7 +265,7 @@ sub fix_comment {
if ($data->{attachment_id} && $method ne 'Bug.search') {
$data->{attachment_ref} = $rpc->type('string', ref_urlbase() .
- "/attachment/" . $data->{attachment_id});
+ "/attachment/" . $object->extra_data);
}
else {
delete $data->{attachment_id};
@@ -332,7 +332,7 @@ sub fix_attachment {
}
if (exists $data->{bug_id}) {
- $data->{bug_ref} = $rpc->type('string', ref_urlbase() . "/bug/" . $data->{bug_id});
+ $data->{bug_ref} = $rpc->type('string', ref_urlbase() . "/bug/" . $object->bug_id);
}
# Upstream API returns these as integers where bzapi returns as booleans
@@ -357,7 +357,7 @@ sub fix_attachment {
delete $data->{flags};
}
- $data->{ref} = $rpc->type('string', ref_urlbase() . "/attachment/" . $data->{id});
+ $data->{ref} = $rpc->type('string', ref_urlbase() . "/attachment/" . $object->id);
# Add update token if we are getting an attachment outside of Bug.get and user is logged in
if ($user->id && ($method eq 'Bug.attachments'|| $method eq 'Bug.search')) {