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

invalid search combinations.
r=jouni
a=justdave
This commit is contained in:
bugreport%peshkin.net 2004-07-22 06:48:59 +00:00
Родитель 10893be580
Коммит f6a3a7f7cf
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -478,6 +478,9 @@ sub init {
push(@fields, $select_term); push(@fields, $select_term);
} }
}, },
"^content," => sub {
ThrowUserError("search_content_without_matches");
},
"^commenter,(?:equals|anyexact),(%\\w+%)" => sub { "^commenter,(?:equals|anyexact),(%\\w+%)" => sub {
my $match = pronoun($1, $user); my $match = pronoun($1, $user);
my $chartseq = $chartid; my $chartseq = $chartid;
@ -828,6 +831,9 @@ sub init {
",lessthan" => sub { ",lessthan" => sub {
$term = "$ff < $q"; $term = "$ff < $q";
}, },
",matches" => sub {
ThrowUserError("search_content_without_matches");
},
",greaterthan" => sub { ",greaterthan" => sub {
$term = "$ff > $q"; $term = "$ff > $q";
}, },

Просмотреть файл

@ -691,6 +691,12 @@
[% title = "Access Denied" %] [% title = "Access Denied" %]
You do not have the permissions necessary to run a sanity check. 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" %] [% ELSIF error == "series_already_exists" %]
[% title = "Series Already Exists" %] [% title = "Series Already Exists" %]
A series named <em>[% series.category FILTER html %] / A series named <em>[% series.category FILTER html %] /