aboutsummaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-01-31 15:18:51 +0800
committerByron Jones <bjones@mozilla.com>2014-01-31 15:18:51 +0800
commitc5464b5bb7dfece2bad2b8af9eba4d9b6d07d778 (patch)
tree092c3a3ecb3152aba305c8ec4323056fc27865e2 /query.cgi
parentcbd6506533f7370ba27c6928e887889627acb6b9 (diff)
downloadbugs-c5464b5bb7dfece2bad2b8af9eba4d9b6d07d778.tar
bugs-c5464b5bb7dfece2bad2b8af9eba4d9b6d07d778.tar.gz
bugs-c5464b5bb7dfece2bad2b8af9eba4d9b6d07d778.tar.bz2
bugs-c5464b5bb7dfece2bad2b8af9eba4d9b6d07d778.tar.xz
bugs-c5464b5bb7dfece2bad2b8af9eba4d9b6d07d778.zip
Bug 956233: enable USE_MEMCACHE on most objects
r=dkl, a=glob
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi9
1 files changed, 6 insertions, 3 deletions
diff --git a/query.cgi b/query.cgi
index 65a7d3c3d..620cf2737 100755
--- a/query.cgi
+++ b/query.cgi
@@ -14,6 +14,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;
@@ -76,9 +77,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 = "";
}