Commit 881bbbd5 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 232491 - try harder to avoid parameterless searches (either saved or…

Bug 232491 - try harder to avoid parameterless searches (either saved or otherwise.) Patch by gerv; r,a=myk.
parent 55f1c210
......@@ -179,7 +179,11 @@ sub LookupNamedQuery {
my $qname = SqlQuote($name);
SendSQL("SELECT query FROM namedqueries WHERE userid = $userid AND name = $qname");
my $result = FetchOneColumn();
$result || ThrowUserError("missing_query", {'queryname' => $name});
defined($result) || ThrowUserError("missing_query", {'queryname' => $name});
$result
|| ThrowUserError("buglist_parameters_required", {'queryname' => $name});
return $result;
}
......@@ -331,8 +335,10 @@ elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) {
$name !~ /[<>&]/ || ThrowUserError("illegal_query_name");
my $qname = SqlQuote($name);
$::FORM{'newquery'} || ThrowUserError("buglist_parameters_required",
{'queryname' => $name});
my $qbuffer = SqlQuote($::FORM{'newquery'});
my $tofooter = 1;
$vars->{'message'} = "buglist_new_named_query";
......
......@@ -118,9 +118,7 @@
[% ELSIF error == "buglist_parameters_required" %]
[% title = "Parameters Required" %]
[% url = "query.cgi" %]
[% link = "Please use the search form to specify some search criteria." %]
This script is not meant to be invoked without any search terms.
You may not search, or create saved searches, without any search terms.
[% ELSIF error == "bugs_not_changed" %]
[% title = BLOCK %][% terms.Bugs %] Not Changed[% END %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment