From 7bb93a27bed6d0bbaebbf63d2472227f7da20b21 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 12 Mar 2014 17:43:20 +0000 Subject: [PATCH] [PASSED QA] Bug 10542: Fix QueryParser with OpacSupression OpacSupressions manipulates the query string after the buildQuery call and so breaks with queryParser enabled. This patch adds checks for queryParser and manipulates the query before passing it to buildQuery if it is enabled, but leaves the post buildQuery manipultation when queryParser is disabled Signed-off-by: Chris Cormack Signed-off-by: Bernardo Gonzalez Kriegel Adding a sing after test Signed-off-by: Katrin Fischer --- opac/opac-search.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 3b37b43..7edaf6d 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -481,11 +481,19 @@ if (C4::Context->preference('OpacSuppression')) { my $IPAddress = $ENV{'REMOTE_ADDR'}; my $IPRange = C4::Context->preference('OpacSuppressionByIPRange'); if ($IPAddress !~ /^$IPRange/) { - $query = "($query) not Suppress=1"; + if ( $query_type eq 'pqf' ) { + $query = "($query) && -(suppress:1)"; + } else { + $query = "($query) not Suppress=1"; + } } } else { - $query = "($query) not Suppress=1"; + if ( $query_type eq 'pqf' ) { + $query = "($query) && -(suppress:1)"; + } else { + $query = "($query) not Suppress=1"; + } } } -- 1.9.1