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

BPS Git Server git at git.bestpractical.com
Tue Oct 11 22:24:07 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  6ac027ee5057225a0112d285f56e947397c6ae30 (commit)

- Log -----------------------------------------------------------------
commit 6ac027ee5057225a0112d285f56e947397c6ae30
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.

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 @@
+# 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';
     ARGSRef          => \%ARGS,
     Query            => \$Query,



More information about the rt-commit mailing list