From 767a65660d0b6f5a3b04243e0d7b6270f3c89b63 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 29 Feb 2012 12:04:54 -0500 Subject: [PATCH] Protect against empty default_CD_modifiers in opensrf.xml If the app settings for the open-ils.search service in opensrf.xml had an empty (but not entirely missing) element, then the open-ils.storage log would contain entries like the following: Use of uninitialized value $class in hash element at /usr/local/share/perl5/OpenILS/Application/Storage/QueryParser.pm Protect against that problem with more defensive code in QueryParser.pm. Signed-off-by: Mike Rylander Signed-off-by: Dan Scott --- .../lib/OpenILS/Application/Storage/Publisher/metabib.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm index eb2602a0ae..22b50f89b8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm @@ -2846,8 +2846,11 @@ sub query_parser_fts { my $default_CD_modifiers = OpenSRF::Utils::SettingsClient->new->config_value( apps => 'open-ils.search' => app_settings => 'default_CD_modifiers' ); - $args{query} = "$default_CD_modifiers $args{query}" if ($default_CD_modifiers); + # Protect against empty / missing default_CD_modifiers setting + if ($default_CD_modifiers and !ref($default_CD_modifiers)) { + $args{query} = "$default_CD_modifiers $args{query}"; + } my $simple_plan = $args{_simple_plan}; # remove bad chunks of the %args hash -- 2.43.2