diff options
author | lpsolit%gmail.com <> | 2007-01-05 02:48:16 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-01-05 02:48:16 +0100 |
commit | a88fc0757d5bd8e70cad0572ab4d29a8817beb84 (patch) | |
tree | 2bd808fb24eb8d30c51df8c4ca6a9ddc508d2a7f /editflagtypes.cgi | |
parent | 069f9bdcec8277cb4d25929335259c44be1f70f4 (diff) | |
download | bugzilla-a88fc0757d5bd8e70cad0572ab4d29a8817beb84.tar.gz bugzilla-a88fc0757d5bd8e70cad0572ab4d29a8817beb84.tar.xz |
Bug 364216: Flag::retarget() is broken (again) - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=myk
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-x | editflagtypes.cgi | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi index 6e001a525..0aec0385d 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -387,8 +387,7 @@ sub update { # 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 $flags = $dbh->selectall_arrayref('SELECT DISTINCT flags.id, flags.bug_id, - flags.attach_id + my $flag_ids = $dbh->selectcol_arrayref('SELECT DISTINCT flags.id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -401,14 +400,13 @@ sub update { WHERE flags.type_id = ? AND i.type_id IS NULL', undef, $id); + my $flags = Bugzilla::Flag->new_from_list($flag_ids); foreach my $flag (@$flags) { - my ($flag_id, $bug_id, $attach_id) = @$flag; - my $bug = new Bugzilla::Bug($bug_id); - my $attachment = $attach_id ? Bugzilla::Attachment->get($attach_id) : undef; - Bugzilla::Flag::clear($flag_id, $bug, $attachment); + my $bug = new Bugzilla::Bug($flag->bug_id); + Bugzilla::Flag::clear($flag, $bug, $flag->attachment); } - $flags = $dbh->selectall_arrayref('SELECT DISTINCT flags.id, flags.bug_id, flags.attach_id + $flag_ids = $dbh->selectcol_arrayref('SELECT DISTINCT flags.id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -420,11 +418,10 @@ sub update { AND (bugs.component_id = e.component_id OR e.component_id IS NULL)', undef, $id); + $flags = Bugzilla::Flag->new_from_list($flag_ids); foreach my $flag (@$flags) { - my ($flag_id, $bug_id, $attach_id) = @$flag; - my $bug = new Bugzilla::Bug($bug_id); - my $attachment = $attach_id ? Bugzilla::Attachment->get($attach_id) : undef; - Bugzilla::Flag::clear($flag_id, $bug, $attachment); + my $bug = new Bugzilla::Bug($flag->bug_id); + Bugzilla::Flag::clear($flag, $bug, $flag->attachment); } # Now silently remove requestees from flags which are no longer |