From de175930957778ea54e318502083b1c46d76eb96 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 17 Jan 2014 09:03:58 -0500 Subject: [PATCH] LP#1268636 Add helpful empty search term message When a search is submitted with no query value, instead of silently redirecting the user the home page, direct the user to the results page and show a helpful message (within the low-hits template). Signed-off-by: Bill Erickson Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 5 +---- Open-ILS/src/templates/opac/parts/result/lowhits.tt2 | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index 1a8740c206..00c4c49c83 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -392,10 +392,7 @@ sub load_rresults { } else { - if (!$query) { - return Apache2::Const::OK if $internal; - return $self->generic_redirect; - } + return Apache2::Const::OK unless $query; # Limit and offset will stay here. Everything else should be part of # the query string, not special args. diff --git a/Open-ILS/src/templates/opac/parts/result/lowhits.tt2 b/Open-ILS/src/templates/opac/parts/result/lowhits.tt2 index 0c7dfb341e..5a69351452 100644 --- a/Open-ILS/src/templates/opac/parts/result/lowhits.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/lowhits.tt2 @@ -17,7 +17,11 @@ IF is_advanced OR is_special; l('Sorry, no entries were found for your search.'); ELSE; - l('Sorry, no entries were found for [_1].', '' _ qhtml _ ''); + IF !qhtml; + l('Please enter a search term in the Search box.'); + ELSE; + l('Sorry, no entries were found for [_1].', '' _ qhtml _ ''); + END; END; END %]

-- 2.11.0