From 268b96c2d4b8be034d209db457afeb4e6d67609e Mon Sep 17 00:00:00 2001 From: Dan Briem Date: Wed, 16 Mar 2022 16:45:37 -0400 Subject: [PATCH] LP#1746800 Exclude empty records on filtered staff searches Excludes empty bibs on staff searches when filtering on location or location group or when using the availability modifier. Signed-off-by: Dan Briem Signed-off-by: Jennifer Weston Signed-off-by: Mike Rylander --- .../perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index c4e345562e..fe45ac1594 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -1057,7 +1057,7 @@ sub toSQL { $final_c_attr_test = 'EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source AND vis_attr_vector @@ c_attr.vis_test)'; } - if ($self->find_modifier('staff')) { # staff search + if ($self->find_modifier('staff') && !$self->find_modifier('available') && !$self->find_filter('locations') && !$self->find_filter('location_groups')) { $final_c_attr_test ||= 'FALSE'; $final_c_attr_test = '(' . $final_c_attr_test . " OR (" . "NOT EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source) " . -- 2.11.0