diff options
author | Byron Jones <bjones@mozilla.com> | 2014-03-04 08:50:54 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2014-03-04 08:50:54 +0100 |
commit | 9193214274889f2b7636146e72d8200e9bfaeb7b (patch) | |
tree | e570cc86aa8df53dd0e7e9d902d88450c5dc25c7 /query.cgi | |
parent | 75eaf0d6c8ecf764d73cb870e504e84826d44751 (diff) | |
download | bugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.gz bugzilla-9193214274889f2b7636146e72d8200e9bfaeb7b.tar.xz |
Bug 966180: backport bug 956233 to bmo (enable USE_MEMCACHE on most objects)
Diffstat (limited to 'query.cgi')
-rwxr-xr-x | query.cgi | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -32,6 +32,7 @@ use Bugzilla; use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Search; +use Bugzilla::Search::Saved; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; @@ -54,9 +55,11 @@ if ($cgi->param('nukedefaultquery')) { if ($userid) { my $token = $cgi->param('token'); check_hash_token($token, ['nukedefaultquery']); - $dbh->do("DELETE FROM namedqueries" . - " WHERE userid = ? AND name = ?", - undef, ($userid, DEFAULT_QUERY_NAME)); + my $named_queries = Bugzilla::Search::Saved->match( + { userid => $userid, name => DEFAULT_QUERY_NAME }); + if (@$named_queries) { + $named_queries->[0]->remove_from_db(); + } } $buffer = ""; } |