From d83e1befce44ae92c0e26c6dfa47a4d3326b0632 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 18 Jun 2014 12:08:17 +0800 Subject: Bug 1026400: id, attachment.id, attachment.bug_id are returned as strings, not integers --- extensions/BzAPI/lib/Util.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extensions/BzAPI') 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')) { -- cgit v1.2.3-24-g4f1b