diff options
author | lpsolit%gmail.com <> | 2006-06-19 07:46:50 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-06-19 07:46:50 +0200 |
commit | 4c74fbe031e5f0b58176ce42220f456e01bb0548 (patch) | |
tree | d0b3ab2c685bf0a2d04c0e602b7ebf8872c9300e /editflagtypes.cgi | |
parent | 1ae6c5f8f166dff351408f570b56ec2adabbedb9 (diff) | |
download | bugzilla-4c74fbe031e5f0b58176ce42220f456e01bb0548.tar.gz bugzilla-4c74fbe031e5f0b58176ce42220f456e01bb0548.tar.xz |
Bug 339750: Remove Bugzilla::Flag::GetBug - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=myk
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-x | editflagtypes.cgi | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi index e055e9d9d..0386fca06 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -41,6 +41,8 @@ use Bugzilla::Group; use Bugzilla::Util; use Bugzilla::Product; use Bugzilla::Component; +use Bugzilla::Bug; +use Bugzilla::Attachment; use List::Util qw(reduce); @@ -384,10 +386,10 @@ sub update { validateAndSubmit($id); $dbh->bz_unlock_tables(); - + # Clear existing flags for bugs/attachments in categories no longer on # the list of inclusions or that have been added to the list of exclusions. - my $flag_ids = $dbh->selectcol_arrayref('SELECT flags.id + my $flags = $dbh->selectall_arrayref('SELECT flags.id, flags.bug_id, flags.attach_id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -400,11 +402,14 @@ sub update { WHERE flags.type_id = ? AND i.type_id IS NULL', undef, $id); - foreach my $flag_id (@$flag_ids) { - Bugzilla::Flag::clear($flag_id); + foreach my $flag (@$flags) { + my ($flag_id, $bug_id, $attach_id) = @$flag; + my $bug = new Bugzilla::Bug($bug_id, $user->id); + my $attachment = $attach_id ? Bugzilla::Attachment->get($attach_id) : undef; + Bugzilla::Flag::clear($flag_id, $bug, $attachment); } - - $flag_ids = $dbh->selectcol_arrayref('SELECT flags.id + + $flags = $dbh->selectall_arrayref('SELECT flags.id, flags.bug_id, flags.attach_id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -416,10 +421,13 @@ sub update { AND (bugs.component_id = e.component_id OR e.component_id IS NULL)', undef, $id); - foreach my $flag_id (@$flag_ids) { - Bugzilla::Flag::clear($flag_id); + foreach my $flag (@$flags) { + my ($flag_id, $bug_id, $attach_id) = @$flag; + my $bug = new Bugzilla::Bug($bug_id, $user->id); + my $attachment = $attach_id ? Bugzilla::Attachment->get($attach_id) : undef; + Bugzilla::Flag::clear($flag_id, $bug, $attachment); } - + $vars->{'name'} = $cgi->param('name'); $vars->{'message'} = "flag_type_changes_saved"; |