From 43dd0fc1e7a1c6f601e30243b363b3e2f358f105 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 25 Jul 2006 07:08:10 +0000 Subject: Bug 345359: Prevent Flag::clear from deleting a deleted flag when checking the inclusion and exclusion lists - Patch by Frédéric Buclin a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Flag.pm | 4 ++-- editflagtypes.cgi | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 6fb5e19d1..25541d06b 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -448,7 +448,7 @@ sub process { # In case the bug's product/component has changed, clear flags that are # no longer valid. my $flag_ids = $dbh->selectcol_arrayref( - "SELECT flags.id + "SELECT DISTINCT flags.id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -463,7 +463,7 @@ sub process { foreach my $flag_id (@$flag_ids) { clear($flag_id, $bug, $attachment) } $flag_ids = $dbh->selectcol_arrayref( - "SELECT flags.id + "SELECT DISTINCT flags.id FROM flags, bugs, flagexclusions e WHERE bugs.bug_id = ? AND flags.bug_id = bugs.bug_id diff --git a/editflagtypes.cgi b/editflagtypes.cgi index 79bf0dd72..1ca6bd94d 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -388,7 +388,8 @@ 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 flags.id, flags.bug_id, flags.attach_id + my $flags = $dbh->selectall_arrayref('SELECT DISTINCT flags.id, flags.bug_id, + flags.attach_id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id @@ -408,7 +409,7 @@ sub update { Bugzilla::Flag::clear($flag_id, $bug, $attachment); } - $flags = $dbh->selectall_arrayref('SELECT flags.id, flags.bug_id, flags.attach_id + $flags = $dbh->selectall_arrayref('SELECT DISTINCT flags.id, flags.bug_id, flags.attach_id FROM flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id -- cgit v1.2.3-24-g4f1b