Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311227 Details for
Bug 454238
bugzilla.getBug and Bug.get don't work as expected
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
v1 fix for functions bugzilla.getBug and Bug.get
getbug.patch (text/plain), 5.72 KB, created by
Noura El hawary
on 2008-07-08 05:33:41 UTC
(
hide
)
Description:
v1 fix for functions bugzilla.getBug and Bug.get
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-07-08 05:33:41 UTC
Size:
5.72 KB
patch
obsolete
>Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.15 >diff -p -u -r1.15 Bug.pm >--- Bugzilla/WebService/Bug.pm 23 Jun 2008 14:28:13 -0000 1.15 >+++ Bugzilla/WebService/Bug.pm 8 Jul 2008 05:22:27 -0000 >@@ -105,6 +105,13 @@ sub get { > # This is done in this fashion in order to produce a stable API. > # The internals of Bugzilla::Bug are not stable enough to just > # return them directly. >+ >+ # REDHAT EXTENSION START 454238 >+ # extract useful needed infomation from external_bugs object that can >+ # be valid return in XML messages >+ $bug->{external_bugs} = $bug->{external_bugs}{bugs}; >+ # REDHAT EXTENSION END 454238 >+ > my $creation_ts = $self->datetime_format($bug->creation_ts); > my $delta_ts = $self->datetime_format($bug->delta_ts); > my %item; >@@ -154,6 +161,10 @@ sub get { > sub get_history { > my ($self, $params) = @_; > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: @{$params->{ids}}, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my $ids = $params->{ids}; > defined $ids || ThrowCodeError('param_required', { param => 'ids' }); > >@@ -208,43 +219,6 @@ sub get_history { > return { bugs => \@return }; > } > >-# this is a function that gets bug activity for list of bug ids >-# it can be called as the following: >-# $call = $rpc->call( 'Bug.get_activity', { ids => [1,2] }); >-sub get_activity { >- my ($self, $params) = @_; >- >- # REDHAT EXTENSION BEGIN 406301 >- $logger->debug("Starting: @{$params->{ids}}, " . Bugzilla->user->login); >- # REDHAT EXTENSION END 406301 >- >- my @ids = ref($params->{ids}) ? @{$params->{ids}} : ($params->{ids}); >- @ids || ThrowCodeError('param_required', { param => 'ids' }); >- >- my @return; >- foreach my $bug_id (@ids) { >- my %item; >- ValidateBugID($bug_id); >- $item{id} = $bug_id; >- >- ( $item{operations}, $item{incomplete_data} ) = Bugzilla::Bug::GetBugActivity($bug_id); >- >- my $bug = new Bugzilla::Bug($bug_id); >- if (Bugzilla->params->{'usebugaliases'}) { >- $item{alias} = type('string')->value($bug->alias); >- } >- else { >- # For API reasons, we always want the value to appear, we just >- # don't want it to have a value if aliases are turned off. >- $item{alias} = undef; >- } >- >- push(@return, \%item); >- } >- >- return { bugs => \@return }; >-} >- > sub create { > my ($self, $params) = @_; > >@@ -1130,85 +1104,6 @@ present in this hash. > > =back > >-=item C<get_activity> B<EXPERIMENTAL> >- >-=over >- >-=item B<Description> >- >-Gets activity about particular bugs in the database. >- >-=item B<Params> >- >-=over >- >-=item C<ids> >- >-An array of numbers and strings, or single value that is a number >-or a string. >- >-If an element in the array or the single value is entirely numeric, >-it represents a bug_id from the Bugzilla database to fetch. If it >-contains any non-numeric characters, it is considered to be a bug >-alias instead, and the bug with that alias will be loaded. >- >-Note that it's possible for aliases to be disabled in Bugzilla, in which >-case you will be told that you have specified an invalid bug_id if you >-try to specify an alias. (It will be error 100.) >- >-=back >- >-=item B<Returns> >- >-A hash containing a single element, C<bugs>. This is an array of hashes. >-Each hash contains the following items: >- >-=over >- >-=item id >- >-C<int> The numeric bug_id of this bug. >- >-=item alias >- >-C<string> The alias of this bug. If there is no alias or aliases are >-disabled in this Bugzilla, this will be an empty string. >- >-=item operations >- >-C<array> An array of hashes with each hash containing C<when>, which is a >-string that holds the date the bug activity/change happened, C<who> which is >-a string that holds the login name for the person who performed the change, >-and C<changes> which is an array of hashes that holds the change details. >- >-=item incomplete_data >- >-C<boolean> Is set to 1 to indicate that there is an old Bugzilla data >-corruption bug, otherwise 0. >- >-=back >- >-=item B<Errors> >- >-=over >- >-=item 100 (Invalid Bug Alias) >- >-If you specified an alias and either: (a) the Bugzilla you're querying >-doesn't support aliases or (b) there is no bug with that alias. >- >-=item 101 (Invalid Bug ID) >- >-The bug_id you specified doesn't exist in the database. >- >-=item 102 (Access Denied) >- >-You do not have access to the bug_id you specified. >- >-=back >- >-=back >- > =item C<create> B<EXPERIMENTAL> > > =over >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/extensions/compat_xmlrpc/code/webservice.pl,v >retrieving revision 1.39 >diff -p -u -r1.39 webservice.pl >--- extensions/compat_xmlrpc/code/webservice.pl 29 May 2008 04:23:17 -0000 1.39 >+++ extensions/compat_xmlrpc/code/webservice.pl 8 Jul 2008 05:22:42 -0000 >@@ -218,9 +218,15 @@ sub getBug { > ValidateBugID($id); > my $bug = new Bugzilla::Bug($id); > ThrowCodeError("bug_error", { bug => $bug }) if $bug->error; >+ >+ # extract useful needed infomation from external_bugs object that can >+ # be valid return in XML messages >+ $bug->{external_bugs} = $bug->{external_bugs}{bugs}; > > my %item; > >+ %item = %$bug; >+ > if ($bug->resolution eq 'DUPLICATE') { > $item{'dup_id'} = $bug->dup_id; > } >@@ -308,6 +314,7 @@ sub getBug { > foreach my $key ( keys %custom_field_return_map ) { > my $field = $custom_field_return_map{$key}; > $item{$key} = $bug->{$field} if defined $bug->{$field}; >+ delete $item{$field}; > } > > return \%item;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dkl
: review-
Actions:
View
|
Diff
Attachments on
bug 454238
:
311227
|
311358