From: Lebbeous Fogle-Weekley Date: Thu, 12 Jul 2012 13:16:12 +0000 (-0400) Subject: Silence undef string concatenation warning in AutoSuggest X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3b2705a0b32580ab3aec9090669a7d0386ca7843;p=evergreen%2Fpines.git 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 --- 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 );