From 246941fdd9f1600d8fc172e3802023bf75dd6266 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Fri, 29 Jun 2018 14:09:51 -0400 Subject: [PATCH] LP1779392: Stop sending broken queries It's possible to send invalid parameters to the search.highlight_display_fields function which wastes a db roundtrip and fills the logs with errors. Checking to be sure there's anything in the parameter will prevent both. Signed-off-by: Jason Boyer Signed-off-by: Mike Rylander --- .../src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index ca3f85a27f..d0c6bc4c01 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -1317,9 +1317,8 @@ sub fetch_display_fields { return; } - my $hl_map_string = "''::HSTORE"; + my $hl_map_string = ""; if (ref($highlight_map) =~ /HASH/) { - $hl_map_string = ""; for my $tsq (keys %$highlight_map) { my $field_list = join(',', @{$$highlight_map{$tsq}}); $hl_map_string .= ' || ' if $hl_map_string; @@ -1330,7 +1329,7 @@ sub fetch_display_fields { my $e = new_editor(); for my $record ( @records ) { - next unless $record; + next unless ($record && $hl_map_string); $conn->respond( $e->json_query( {from => ['search.highlight_display_fields', $record, $hl_map_string]} -- 2.43.2