]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 286041 - Allow people to undo "forget search"
authorKent Rogers <kar@cray.com>
Mon, 1 Mar 2010 23:24:36 +0000 (15:24 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 1 Mar 2010 23:24:36 +0000 (15:24 -0800)
r=mkanat, a=mkanat

buglist.cgi
template/en/default/global/messages.html.tmpl

index a472edee4f810bca89f06de0bade0a1c5b999fb5..810dd7b004d95e9f50aaf78ffe14a48a03ce8286 100755 (executable)
@@ -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;
index 1f63da79b4ddfb757a9dc96a6a54b72ef969b859..5364f1e986298d98807808fa7a135cf757170a6e 100644 (file)
 
   [% 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" %]