Commit f32106f8 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 385910: Add parameter to allow "find a specific bug" to accept an empty…

Bug 385910: Add parameter to allow "find a specific bug" to accept an empty search - Patch by Brad Johnson <fk7q01p02@sneakemail.com> r/a=LpSolit
parent 8699690c
...@@ -72,7 +72,15 @@ sub get_param_list { ...@@ -72,7 +72,15 @@ sub get_param_list {
type => 't', type => 't',
default => '4', default => '4',
checker => \&check_numeric checker => \&check_numeric
} ); },
{
name => 'quicksearch_allow_empty_words',
type => 'b',
default => 0
}
);
return @param_list; return @param_list;
} }
......
...@@ -74,9 +74,12 @@ if (defined($searchstring)) { ...@@ -74,9 +74,12 @@ if (defined($searchstring)) {
# as if this had been a normal query from the beginning. # as if this had been a normal query from the beginning.
} }
# Reject empty searches from the simple search form, including # If configured to not allow empty words, reject empty searches from the
# words being a single or several consecutive whitespaces only. # simple search form, including words being a single or several consecutive
if (defined($cgi->param('content')) && $cgi->param('content') =~ /^\s*$/) { # whitespaces only.
if (!Bugzilla->params->{'quicksearch_allow_empty_words'}
&& defined($cgi->param('content')) && $cgi->param('content') =~ /^\s*$/)
{
ThrowUserError("buglist_parameters_required"); ThrowUserError("buglist_parameters_required");
} }
......
...@@ -54,5 +54,7 @@ ...@@ -54,5 +54,7 @@
quicksearch_comment_cutoff => "The maximum number of search terms for a QuickSearch " _ quicksearch_comment_cutoff => "The maximum number of search terms for a QuickSearch " _
"to search comments. If the QuickSearch query contains " _ "to search comments. If the QuickSearch query contains " _
"more terms than this value, QuickSearch will not search comments." } "more terms than this value, QuickSearch will not search comments.",
quicksearch_allow_empty_words => "Whether to allow a QuickSearch with empty Words." }
%] %]
...@@ -109,12 +109,17 @@ for "crash secure SSL flash". ...@@ -109,12 +109,17 @@ for "crash secure SSL flash".
<tr> <tr>
<td></td> <td></td>
<td> <td>
<input type="submit" id="search" value="Search"
[% IF Param('quicksearch_allow_empty_words') %]
<input type="submit" id="search" value="Search">
[% ELSE %]
<input type="submit" id="search" value="Search"
onclick="if (this.form.content.value == '') onclick="if (this.form.content.value == '')
{alert('The Words field cannot be empty. You have to ' + {alert('The Words field cannot be empty. You have to ' +
'enter at least one word in your search criteria.'); 'enter at least one word in your search criteria.');
return false;} return true;"> return false;} return true;">
</td> [% END %]
</td>
</tr> </tr>
</table> </table>
</form> </form>
......
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