From 38e12dd8a2c0b35391f20b60e9e3e8643c08f404 Mon Sep 17 00:00:00 2001 From: Matt Tyson Date: Fri, 15 Jan 2016 14:44:09 +0000 Subject: 'Bug 1159057: change to create flags as part of bug creation process. r=gerv --- Bugzilla/Bug.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index bd3bf587c..4f12c179f 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -689,6 +689,7 @@ sub possible_duplicates { # user is not a member of the timetrackinggroup. # C - For time-tracking. Will be ignored for the same # reasons as C. +# C - An array of flags that will be applied to the bug. sub create { my ($class, $params) = @_; my $dbh = Bugzilla->dbh; @@ -724,6 +725,7 @@ sub create { my $is_markdown = delete $params->{is_markdown}; my $see_also = delete $params->{see_also}; my $comment_tags = delete $params->{comment_tags}; + my $flags = delete $params->{flags}; # We don't want the bug to appear in the system until it's correctly # protected by groups. @@ -806,6 +808,14 @@ sub create { delete $bug->{_update_ref_bugs}; } + # Apply any flags. + if (defined $flags) { + $bug->set_flags($flags); + foreach my $flag (@{$bug->flags}) { + Bugzilla::Flag->create($flag); + } + } + # Comment #0 handling... # We now have a bug id so we can fill this out -- cgit v1.2.3-24-g4f1b