Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 295483 Details for
Bug 433744
Implement Bugzilla::Bug set_all, which takes parameters from a hash and does all updates in the right order
Home
New
Search
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.rh90 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]
initial patch for function Bugzilla::Bug::set_all($args)
patch.diff (text/plain), 5.52 KB, created by
Noura El hawary
on 2008-02-21 05:07:40 UTC
(
hide
)
Description:
initial patch for function Bugzilla::Bug::set_all($args)
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-02-21 05:07:40 UTC
Size:
5.52 KB
patch
obsolete
>Index: Bugzilla/Bug.pm >=================================================================== >RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v >retrieving revision 1.233 >diff -3 -p -u -r1.233 Bug.pm >--- Bugzilla/Bug.pm 12 Feb 2008 21:13:07 -0000 1.233 >+++ Bugzilla/Bug.pm 21 Feb 2008 04:54:51 -0000 >@@ -493,6 +493,125 @@ sub run_create_validators { > return $params; > } > >+sub set_all { >+ my ($self, $args) = @_; >+ >+ # For security purposes, and because lots of other checks depend on it, >+ # we set the product first before anything else. >+ my $product_change; # Used only for strict_isolation checks, right now. >+ if ($args->{product}) { >+ my $changed = $self->set_product($args->{product}, >+ { component => $args->{component}, >+ version => $args->{version}, >+ target_milestone => $args->{target_milestone}, >+ change_confirmed => $args->{confirm_product_change}, >+ other_bugs => $args->{bug_objects}, >+ }); >+ $product_change ||= $changed; >+ } >+ >+ # add/remove groups >+ $self->remove_group($_) foreach @{$args->{remove_group}}; >+ $self->add_group($_) foreach @{$args->{add_group}}; >+ >+ # set dependson and blocked >+ if ($args->{dependson} || $args->{blocked}) { >+ $self->set_dependencies($args->{dependson}, $args->{blocked}); >+ } >+ >+ # set keywords , the hash key for the keywords can either be >+ # add_keywords, delete_keywords, or makeexact_keywords >+ # get the action from the hash key name >+ foreach my $key_name (keys %$args){ >+ if ($key_name =~ /([a-z]*)_keywords$/){ >+ my $keyword_action = $1; >+ $self->modify_keywords($args->{$key_name}, $keyword_action); >+ } >+ } >+ >+ # Component, target_milestone, and version are in here just in case >+ # the 'product' field wasn't defined in the args hash. It doesn't hurt >+ # to set them twice. >+ my @set_fields = qw(op_sys rep_platform priority bug_severity >+ component target_milestone version >+ bug_file_loc status_whiteboard short_desc >+ deadline remaining_time estimated_time); >+ >+ push(@set_fields, 'assigned_to') if !$args->{set_default_assignee}; >+ push(@set_fields, 'qa_contact') if !$args->{set_default_qa_contact}; >+ >+ my @custom_fields = Bugzilla->get_fields({custom => 1, obsolete => 0}); >+ >+ my %methods = ( >+ bug_severity => 'set_severity', >+ rep_platform => 'set_platform', >+ short_desc => 'set_summary', >+ bug_file_loc => 'set_url', >+ ); >+ >+ # adding comment to a bug >+ if ($args->{comment} || $args->{work_time}) { >+ # Add a comment as needed to the bug. This is done early because >+ # there are lots of things that want to check if we added a comment. >+ $self->add_comment($args->{comment}, >+ { isprivate => $args->{commentprivacy}, >+ work_time => $args->{work_time} }); >+ } >+ foreach my $field_name (@set_fields) { >+ if ($args->{$field_name}) { >+ my $method = $methods{$field_name}; >+ $method ||= "set_" . $field_name; >+ $self->$method($args->{$field_name}); >+ } >+ } >+ $args->reset_assigned_to if $args->{set_default_assignee}; >+ $args->reset_qa_contact if $args->{set_default_qa_contact}; >+ >+ # And set custom fields. >+ foreach my $field (@custom_fields) { >+ my $fname = $field->name; >+ if ($args->{$fname}) { >+ $self->set_custom_field($field, [$args->{$fname}]); >+ } >+ } >+ >+ if (Bugzilla->params->{"usebugaliases"} && $args->{alias}) { >+ $self->set_alias($args->{alias}); >+ } >+ >+ # set reporter_accessible and cclist_accessible >+ $self->set_cclist_accessible($args->{cclist_accessible}) if $args->{cclist_accessible}; >+ $self->set_reporter_accessible($args->{reporter_accessible}) if $args->{reporter_accessible}; >+ >+ # mark an existing comment as private by its id. note the user >+ # must be in the insidergroup or his change will be ignored >+ $self->set_comment_is_private($args->{comment_id}, $args->{comment_privacy}); >+ >+ # add/remove cc >+ $self->remove_cc($_) foreach @{$args->{remove_cc}}; >+ $self->add_cc($_) foreach @{$args->{add_cc}}; >+ >+ if ($product_change) { >+ # Theoretically you could move a product without ever specifying >+ # a new assignee or qa_contact, or adding/removing any CCs. So, >+ # we have to check that the current assignee, qa, and CCs are still >+ # valid if we've switched products, under strict_isolation. We can only >+ # do that here. There ought to be some better way to do this, >+ # 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 >+ $self->process_knob($args->{knob}, $args->{resolution}, $args->{dup_id}); >+ >+} >+ > sub update { > my $self = shift; >
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
Actions:
View
|
Diff
Attachments on
bug 433744
:
295483
|
296081
|
296620
|
296768
|
297132
|
297564
|
297565