From 3b2705a0b32580ab3aec9090669a7d0386ca7843 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 12 Jul 2012 09:16:12 -0400 Subject: [PATCH] Silence undef string concatenation warning in AutoSuggest Addressing LP #1023651 reported by Dan Scott. When building a cache key, use processed input values that are guaranteed to be defined rather than raw ones. This will mean brief cache misses for AutoSuggest once applied, but the default life of AutoSuggest cache entries is only 5 minutes anyway. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/WWW/AutoSuggest.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AutoSuggest.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AutoSuggest.pm index c0a92463a5..220f1b2466 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AutoSuggest.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AutoSuggest.pm @@ -94,9 +94,9 @@ sub prepare_headline_opts { # Get raw autosuggest data (rows returned from a stored procedure) from the DB. sub get_suggestions { my $editor = shift; - my $query = shift; - my $search_class = shift; - my $org_unit = shift; + my $query = shift || ""; # avoid noise about undef + my $search_class = shift || ""; + my $org_unit = shift || -1; my $css_prefix = shift || 'oils_AS'; my $highlight_min = int(shift || 0); my $highlight_max = int(shift || 0); @@ -118,12 +118,9 @@ sub get_suggestions { $query . $search_class . $org_unit . - $css_prefix . - $highlight_min . - $highlight_max . $normalization . $limit . - $short_word_length + $headline_opts ); my $res = $cache->get_cache( $key ); -- 2.11.0