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 302563 Details for
Bug 440022
Fix code for function Bug.update to work with upstream changes to Bug.pm and process_bug.cgi
[?]
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 patch to fix Bug.update to work with latest changes to Bugzilla/Bug.pm
bug_update_xmlrpc (text/plain), 7.90 KB, created by
Noura El hawary
on 2008-04-16 09:01:40 UTC
(
hide
)
Description:
v1 patch to fix Bug.update to work with latest changes to Bugzilla/Bug.pm
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-04-16 09:01:40 UTC
Size:
7.90 KB
patch
obsolete
>Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.10 >diff -p -u -r1.10 Bug.pm >--- Bugzilla/WebService/Bug.pm 2 Apr 2008 00:46:28 -0000 1.10 >+++ Bugzilla/WebService/Bug.pm 16 Apr 2008 08:55:07 -0000 >@@ -589,15 +589,15 @@ sub update { > my ($self, $params) = @_; > my $user = Bugzilla->login(LOGIN_REQUIRED); > >- # REDHAT EXTENSION BEGIN 406301 >- $logger->debug("Starting: ids => @{$params->{ids}}, " . Bugzilla->user->login); >- # REDHAT EXTENSION END 406301 >- > $params->{ids} || ThrowCodeError('param_required', { param => 'ids' }); > my $updates = $params->{updates} || ThrowCodeError('param_required', { param => 'updates' }); > > my @ids = ref($params->{ids}) ? @{$params->{ids}} : ($params->{ids}); > >+ # REDHAT EXTENSION BEGIN 406301 >+ $logger->debug("Starting: ids => @ids, " . Bugzilla->user->login); >+ # REDHAT EXTENSION END 406301 >+ > my @valid_ids; > foreach my $bug_id (@ids) { > ValidateBugID($bug_id); >@@ -637,24 +637,17 @@ sub update { > foreach my $group (@{$bug->product_obj->groups_valid}) { > my $gid = $group->id; > my $gname = $group->name; >- if (grep {$_ =~ /$gname/ } @{$updates->{remove_group}}) { >- push (@{$args->{remove_group}}, $gid); >+ if (grep {$_ =~ /$gname/ } @{$updates->{delete_group}}) { >+ push (@{$args->{delete_group}}, $gid); > } > elsif (grep {$_ =~ /$gname/ } @{$updates->{add_group}}) { > push (@{$args->{add_group}}, $gid); > } > } > >- > # dependson and blocked lists should be passed as string of bug ids > # separated by commas to set_all >- if (scalar @bug_objects > 1 && (defined $updates->{delete_dependson} >- || defined $updates->{delete_blocked} >- || defined $updates->{add_dependson} >- || defined $updates->{add_blocked})) { >- ThrowUserError("dependencies_not_allowed"); >- } >- else { >+ if (scalar @bug_objects == 1) { > my %dependson_ids; > map { $dependson_ids{$_} = 1 } @{$bug->dependson}; > delete $dependson_ids{$_} foreach @{$updates->{delete_dependson}}; >@@ -751,29 +744,25 @@ sub update { > ThrowUserError('alias_not_allowed'); > } > >- # Set the status, resolution, and dupe_of (if needed). This has to be done >- # down here, because the validity of status changes depends on other fields, >- # such as Target Milestone. >- if ( defined $updates->{bug_status} && ($bug->status->name ne $updates->{bug_status}) >- && (is_open_state($updates->{bug_status})) ) { >- $args->{knob} = $updates->{bug_status}; >- } >- elsif ( defined $updates->{bug_status} && ($bug->status->name ne $updates->{bug_status}) >- && !(is_open_state($updates->{bug_status})) ) { >- $args->{knob} = $updates->{bug_status}; >- $args->{resolution} = $updates->{resolution}; >+ if (scalar @bug_objects > 1 && ($updates->{delete_dependson} >+ || $updates->{delete_blocked} >+ || $updates->{add_dependson} >+ || $updates->{add_blocked})) { >+ >+ ThrowUserError("dependencies_not_allowed"); > } >- elsif ( defined $updates->{resolution} && ($bug->resolution ne $updates->{resolution}) >- && !(is_open_state($bug->status->name)) ) { >- $args->{knob} = 'change_resolution'; >+ >+ $args->{bug_status} = $updates->{bug_status} || ''; >+ >+ if ($updates->{resolution}){ > $args->{resolution} = $updates->{resolution}; >+ $args->{bug_status} = 'CLOSED'; > } >- elsif ( defined $updates->{dupe_id} ) { >- $args->{knob} = 'duplicate'; >+ >+ if ($updates->{dupe_id}){ > $args->{dupe_id} = $updates->{dupe_id}; >- } >- else { >- $args->{knob} = 'none'; >+ $args->{bug_status} = 'CLOSED'; >+ $args->{resolution} = 'DUPLICATE'; > } > > $bug->set_all($args); >@@ -789,19 +778,6 @@ sub update { > my $bug_changes = $bug->update($timestamp); > $changes{$bug->bug_id} = [$bug_changes]; > >- my $keyword_changes= $bug->update_keywords($timestamp); >- push @{$changes{$bug->bug_id}}, {keywords => $keyword_changes} >- if (scalar $keyword_changes->[0][0] || scalar $keyword_changes->[0][1]); >- >- my ($cc_removed) = $bug->update_cc($timestamp); >- $cc_removed = [map {$_->login} @$cc_removed]; >- push @{$changes{$bug->bug_id}}, {cc => $cc_removed} if scalar @$cc_removed; >- >- my ($dep_changes) = $bug->update_dependencies($timestamp); >- push @{$changes{$bug->bug_id}}, {dependencies => $dep_changes} >- if (scalar $dep_changes->{dependson}->[0][0] || scalar $dep_changes->{dependson}->[0][1] >- || scalar $dep_changes->{blocked}->[0][0] || scalar $dep_changes->{blocked}->[0][1]); >- > my $mail_results = Bugzilla::BugMail::Send($bug->bug_id, { changer => Bugzilla->user->login }); > push @{$changes{$bug->bug_id}}, $mail_results; > >@@ -1340,7 +1316,7 @@ items C<component>, C<version>, C<target > =item C<target_milestone> (string) - A valid new target milestone for the > product. > >-=item C<remove_group> (array) - An array of group names to be deleted from >+=item C<delete_group> (array) - An array of group names to be deleted from > the bug, any group name that doesn't belong to the bug product will be > ignored. > >@@ -1428,7 +1404,7 @@ to make the bug accessible to its report > > =item C<delete_cc> (array) - An array of usernames to remove from the CC on this bug. > >-=item C<status> (string) - The new status for the bug. >+=item C<bug_status> (string) - The new status for the bug. > > =item C<resolution> (string) - The new resolution of the bug. > >Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Bug.pm,v >retrieving revision 1.34 >diff -p -u -r1.34 Bug.pm >--- Bugzilla/Bug.pm 11 Apr 2008 04:41:41 -0000 1.34 >+++ Bugzilla/Bug.pm 16 Apr 2008 08:55:17 -0000 >@@ -553,7 +553,7 @@ sub set_all { > } > > # add/remove groups >- $self->remove_group($_) foreach @{$args->{remove_group}}; >+ $self->remove_group($_) foreach @{$args->{delete_group}}; > $self->add_group($_) foreach @{$args->{add_group}}; > > # set dependson and blocked >@@ -631,17 +631,24 @@ sub set_all { > # architecturally, but I haven't come up with it. > $self->_check_strict_isolation(); > } >- >+ > # Set the status, resolution, and dupe_of (if needed). This has to be done > # down here, because the validity of status changes depends on other fields, > # such as Target Milestone. >- # the hash key for >- # NOTE: not sure if knob here is the right thing to do as knob can >- # be the actual bug status or the action to be performed on >- # the bug status and resolution >- $args->{knob} ||= 'none'; >- $self->process_knob($args->{knob}, $args->{resolution}, $args->{dupe_id}); >- >+ if ($args->{bug_status}) { >+ $self->set_status( >+ scalar $args->{bug_status}, >+ {resolution => scalar $args->{resolution}, >+ dupe_of => scalar $args->{dupe_id}} >+ ); >+ } >+ elsif ($args->{resolution}) { >+ $b->set_resolution(scalar $args->{resolution}, >+ {dupe_of => scalar $args->{dupe_id}}); >+ } >+ elsif ($args->{dupe_id}) { >+ $b->set_dup_id(scalar $args->{dupe_id}); >+ } > } > > sub update {
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 440022
: 302563