From 485c9cdaed8a6dd0f2249fc7a774e2125aed2288 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 7 Nov 2017 11:09:07 -0500 Subject: [PATCH] LP#1723977: Move no-LURIs test to be a peer of no-copies test The correct place to test the no-LURIs condition is as a peer to the no-copies test, when searching in staff mode. We therefore move that test with this commit. Signed-off-by: Mike Rylander --- .../lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 f643d5f228..db9bbef945 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 @@ -1014,7 +1014,10 @@ 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 (!$pc_vis_test) { # staff search - $final_c_attr_test = '(' . $final_c_attr_test . ' OR NOT EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source))'; + $final_c_attr_test = '(' . $final_c_attr_test . " OR (" . + "NOT EXISTS (SELECT 1 FROM asset.copy_vis_attr_cache WHERE record = m.source) " . + "AND NOT ( int3range(0,268435455,'[]') @> ANY(bre.vis_attr_vector) )". + "))"; } } @@ -1051,9 +1054,6 @@ sub toSQL { # These are magic numbers... see: search.calculate_visibility_attribute() UDF $final_b_attr_test = '(b_attr.vis_test IS NULL OR bre.vis_attr_vector @@ b_attr.vis_test)'; - if (!$pb_vis_test) { # staff search - $final_b_attr_test .= " OR NOT ( int4range(0,268435455,'[]') @> ANY(bre.vis_attr_vector) )"; - } } if ($final_c_attr_test or $final_b_attr_test) { # something... -- 2.11.0