[Rt-commit] rt branch 5.0/provide-select-all-when-query-string-is-empty created. rt-5.0.3-125-g485b902b0d

BPS Git Server git at git.bestpractical.com
Mon Dec 12 14:46:08 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/provide-select-all-when-query-string-is-empty has been created
        at  485b902b0d8a1a63be7a2781d7d63f4850739925 (commit)

- Log -----------------------------------------------------------------
commit 485b902b0d8a1a63be7a2781d7d63f4850739925
Author: Brian Conry <bconry at bestpractical.com>
Date:   Tue Jun 21 15:08:20 2022 -0500

    Provide default 'select all' query string
    
    Some simple search terms are simplified down to an empty string, which
    is usually construed as meaning "give me everything".  This change
    provides a default in Results.html that should generally select
    everything when no other criteria is provided.
    
    This prevents displaying an "error parsing your search query" message
    to the user when their search term was factored away, or when they
    provided an empty search term.
    
    Fixes: I#36902

diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index e0de84d99f..ff092e6c95 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -113,6 +113,15 @@
 </div>
 
 <%INIT>
+# Some valid query criteria can be simplified down to an empty
+# string by the time this component is called, and in many
+# contexts (e.g. SQL) an empty criteria set is shorthand for
+# "give me everything", so default in a non-empty query that
+# will give the expected results in both of those cases.
+# This is done before the callback so that it sees the same
+# query that we're going to operate on.
+$Query ||= 'id > 0';
+
 $m->callback(
     ARGSRef          => \%ARGS,
     Query            => \$Query,

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list