summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Rogers <kar@cray.com>2010-03-02 00:24:36 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-03-02 00:24:36 +0100
commitcab671b774f077dbb47bf8904fb11cca60204ab0 (patch)
tree3d0976bf77ad5c52555d654d30e4f6d3d60de7a9
parent78be753e3be38903b0eeb81e36a7c51704bc6cf3 (diff)
downloadbugzilla-cab671b774f077dbb47bf8904fb11cca60204ab0.tar.gz
bugzilla-cab671b774f077dbb47bf8904fb11cca60204ab0.tar.xz
Bug 286041 - Allow people to undo "forget search"
r=mkanat, a=mkanat
-rwxr-xr-xbuglist.cgi9
-rw-r--r--template/en/default/global/messages.html.tmpl2
2 files changed, 5 insertions, 6 deletions
diff --git a/buglist.cgi b/buglist.cgi
index a472edee4..810dd7b00 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -456,10 +456,9 @@ if ($cmdtype eq "dorem") {
}
# If we are here, then we can safely remove the saved search
- my ($query_id) = $dbh->selectrow_array('SELECT id FROM namedqueries
- WHERE userid = ?
- AND name = ?',
- undef, ($user->id, $qname));
+ my $query_id;
+ ($buffer, $query_id) = LookupNamedQuery(scalar $cgi->param("namedcmd"),
+ $user->id);
if (!$query_id) {
# The user has no query of this name. Play along.
}
@@ -486,7 +485,7 @@ if ($cmdtype eq "dorem") {
# Generate and return the UI (HTML page) from the appropriate template.
$vars->{'message'} = "buglist_query_gone";
$vars->{'namedcmd'} = $qname;
- $vars->{'url'} = "query.cgi";
+ $vars->{'url'} = "buglist.cgi?newquery=" . url_quote($buffer) . "&cmdtype=doit&remtype=asnamed&newqueryname=" . url_quote($qname);
$template->process("global/message.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
exit;
diff --git a/template/en/default/global/messages.html.tmpl b/template/en/default/global/messages.html.tmpl
index 1f63da79b..5364f1e98 100644
--- a/template/en/default/global/messages.html.tmpl
+++ b/template/en/default/global/messages.html.tmpl
@@ -144,7 +144,7 @@
[% ELSIF message_tag == "buglist_query_gone" %]
[% title = "Search is gone" %]
- [% link = "Go back to the search page." %]
+ [% link = "Un-forget the search" %]
OK, the <b>[% namedcmd FILTER html %]</b> search is gone.
[% ELSIF message_tag == "buglist_sorted_by_relevance" %]