Commit 43dd0fc1 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 345359: Prevent Flag::clear from deleting a deleted flag when checking the…

Bug 345359: Prevent Flag::clear from deleting a deleted flag when checking the inclusion and exclusion lists - Patch by Frédéric Buclin <LpSolit@gmail.com> a=myk
parent 2904ac32
...@@ -448,7 +448,7 @@ sub process { ...@@ -448,7 +448,7 @@ sub process {
# In case the bug's product/component has changed, clear flags that are # In case the bug's product/component has changed, clear flags that are
# no longer valid. # no longer valid.
my $flag_ids = $dbh->selectcol_arrayref( my $flag_ids = $dbh->selectcol_arrayref(
"SELECT flags.id "SELECT DISTINCT flags.id
FROM flags FROM flags
INNER JOIN bugs INNER JOIN bugs
ON flags.bug_id = bugs.bug_id ON flags.bug_id = bugs.bug_id
...@@ -463,7 +463,7 @@ sub process { ...@@ -463,7 +463,7 @@ sub process {
foreach my $flag_id (@$flag_ids) { clear($flag_id, $bug, $attachment) } foreach my $flag_id (@$flag_ids) { clear($flag_id, $bug, $attachment) }
$flag_ids = $dbh->selectcol_arrayref( $flag_ids = $dbh->selectcol_arrayref(
"SELECT flags.id "SELECT DISTINCT flags.id
FROM flags, bugs, flagexclusions e FROM flags, bugs, flagexclusions e
WHERE bugs.bug_id = ? WHERE bugs.bug_id = ?
AND flags.bug_id = bugs.bug_id AND flags.bug_id = bugs.bug_id
......
...@@ -388,7 +388,8 @@ sub update { ...@@ -388,7 +388,8 @@ sub update {
# Clear existing flags for bugs/attachments in categories no longer on # 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. # 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 FROM flags
INNER JOIN bugs INNER JOIN bugs
ON flags.bug_id = bugs.bug_id ON flags.bug_id = bugs.bug_id
...@@ -408,7 +409,7 @@ sub update { ...@@ -408,7 +409,7 @@ sub update {
Bugzilla::Flag::clear($flag_id, $bug, $attachment); 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 FROM flags
INNER JOIN bugs INNER JOIN bugs
ON flags.bug_id = bugs.bug_id ON flags.bug_id = bugs.bug_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment