Commit bb587d71 authored by bugreport%peshkin.net's avatar bugreport%peshkin.net

Bug 238544: Emit appropriate error if content and matches are used in

invalid search combinations. r=jouni a=justdave
parent 96998d6a
......@@ -478,6 +478,9 @@ sub init {
push(@fields, $select_term);
}
},
"^content," => sub {
ThrowUserError("search_content_without_matches");
},
"^commenter,(?:equals|anyexact),(%\\w+%)" => sub {
my $match = pronoun($1, $user);
my $chartseq = $chartid;
......@@ -828,6 +831,9 @@ sub init {
",lessthan" => sub {
$term = "$ff < $q";
},
",matches" => sub {
ThrowUserError("search_content_without_matches");
},
",greaterthan" => sub {
$term = "$ff > $q";
},
......
......@@ -691,6 +691,12 @@
[% title = "Access Denied" %]
You do not have the permissions necessary to run a sanity check.
[% ELSIF error == "search_content_without_matches" %]
[% title = "Illegal Search" %]
The "content" field can only be used with "matches" search
and the "matches" search can only be used with the "content"
field.
[% ELSIF error == "series_already_exists" %]
[% title = "Series Already Exists" %]
A series named <em>[% series.category FILTER html %] /
......
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