summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fearn <jfearn@redhat.com>2022-11-02 19:13:34 +1000
committerJeff Fearn <jfearn@redhat.com>2022-11-02 19:13:34 +1000
commit156bfaf91ca79e2778da5676ebe0402ff8c0ab98 (patch)
tree0a61ca629e11ae73f0a2029ad3488458ae51138a
parentRelease Version 5.0.4-rh78 (diff)
downloadbugzilla-156bfaf91ca79e2778da5676ebe0402ff8c0ab98.tar.gz
bugzilla-156bfaf91ca79e2778da5676ebe0402ff8c0ab98.tar.bz2
bugzilla-156bfaf91ca79e2778da5676ebe0402ff8c0ab98.zip
Bug 2139335 - XMLRPC started to provide external link ID as integer (instead of string)
Pass thorugh web service so types can be forced. Change-Id: I6c8757408d40d3955b4d2600c33a6c9e798f94eb
-rw-r--r--Bugzilla/WebService/Bug.pm6
-rw-r--r--extensions/ExternalBugs/Extension.pm16
2 files changed, 12 insertions, 10 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 3c70c3e6c..5e593f5be 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -527,7 +527,7 @@ sub get {
## REDHAT EXTENSION START 1376322
Bugzilla::Hook::process('bugs_to_hashes',
- {bugs => \@bugs, hashes => \@hashes, params => $params,});
+ {bugs => \@bugs, hashes => \@hashes, params => $params, web_service => $self});
## REDHAT EXTENSION END 1376322
return {bugs => \@hashes, faults => \@faults};
@@ -809,7 +809,7 @@ sub search {
## REDHAT EXTENSION START 1376322
Bugzilla::Hook::process('bugs_to_hashes',
- {bugs => \@bugs, hashes => \@hashes, params => $params,});
+ {bugs => \@bugs, hashes => \@hashes, params => $params, web_service => $self,});
## REDHAT EXTENSION END 1376322
## REDHAT EXTENSION START 1865757
@@ -948,7 +948,7 @@ sub possible_duplicates {
## REDHAT EXTENSION START 1376322
Bugzilla::Hook::process('bugs_to_hashes',
- {bugs => $possible_dupes, hashes => \@hashes, params => $params,});
+ {bugs => $possible_dupes, hashes => \@hashes, params => $params, web_service => $self,});
## REDHAT EXTENSION END 1376322
return {bugs => \@hashes};
diff --git a/extensions/ExternalBugs/Extension.pm b/extensions/ExternalBugs/Extension.pm
index 56bfc6b94..050cbfd27 100644
--- a/extensions/ExternalBugs/Extension.pm
+++ b/extensions/ExternalBugs/Extension.pm
@@ -21,8 +21,8 @@ use Bugzilla::Extension::ExternalBugs::Type;
use Bugzilla::Extension::ExternalBugs::Regex;
use Bugzilla::Extension::ExternalBugs::Util qw(resolve_ext_tracker_url);
-use Clone qw(clone);
-use Scalar::Util qw(tainted blessed looks_like_number);
+use Clone qw(clone);
+use Scalar::Util qw(tainted blessed looks_like_number);
use List::MoreUtils qw(any none);
our $VERSION = 0.3;
@@ -1795,8 +1795,10 @@ sub _user_can_see_ext_bz {
sub bugs_to_hashes {
my ($self, $args) = @_;
- my $params = $args->{params};
- my $user = Bugzilla->user;
+ my $params = $args->{params};
+ my $web_service = $args->{'web_service'};
+
+ my $user = Bugzilla->user;
my $orig_extra_fields = $params->{'allowed_extra_fields'};
@@ -1819,7 +1821,7 @@ sub bugs_to_hashes {
|| (filter_wants $params, 'ext_bz_list', 'extra'))
{
$item->{external_bugs}
- = [map { $self->_extbz_to_hash($_) } @{$bug->external_bugs}];
+ = [map { $self->_extbz_to_hash($_, $web_service) } @{$bug->external_bugs}];
}
## REDHAT EXTENSION END 406161 1010842
@@ -1832,14 +1834,14 @@ sub bugs_to_hashes {
## REDHAT EXTENSION START 1010842
sub _extbz_to_hash {
- my ($self, $ext_bz) = @_;
+ my ($self, $ext_bz, $web_service) = @_;
my $type = $ext_bz->type;
my $item = {
id => $ext_bz->id,
bug_id => $ext_bz->bug_id,
ext_bz_id => $ext_bz->ext_bz_id,
- ext_bz_bug_id => "" . $ext_bz->ext_bz_bug_id,
+ ext_bz_bug_id => $web_service->type('string', $ext_bz->ext_bz_bug_id),
ext_status => $ext_bz->ext_status,
ext_priority => $ext_bz->ext_priority,
ext_description => $ext_bz->ext_description,