summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/BugmailFilter/Extension.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/extensions/BugmailFilter/Extension.pm b/extensions/BugmailFilter/Extension.pm
index 4cbf3d984..dc38e8577 100644
--- a/extensions/BugmailFilter/Extension.pm
+++ b/extensions/BugmailFilter/Extension.pm
@@ -98,11 +98,12 @@ sub user_preferences {
my $ids = ref($input->{remove}) ? $input->{remove} : [ $input->{remove} ];
my $dbh = Bugzilla->dbh;
+ my $user = Bugzilla->user;
+
+ my $filters = Bugzilla::Extension::BugmailFilter::Filter->match({ id => $ids, user_id => $user->id });
$dbh->bz_start_transaction;
- foreach my $id (@$ids) {
- if (my $filter = Bugzilla::Extension::BugmailFilter::Filter->new($id)) {
- $filter->remove_from_db();
- }
+ foreach my $filter (@$filters) {
+ $filter->remove_from_db();
}
$dbh->bz_commit_transaction;
}