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 <chrisc@catalyst.net.nz> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Adding a sing after test Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
parent
27eccf4122
commit
449b365a48
1 changed files with 10 additions and 2 deletions
|
@ -481,11 +481,19 @@ if (C4::Context->preference('OpacSuppression')) {
|
||||||
my $IPAddress = $ENV{'REMOTE_ADDR'};
|
my $IPAddress = $ENV{'REMOTE_ADDR'};
|
||||||
my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
|
my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
|
||||||
if ($IPAddress !~ /^$IPRange/) {
|
if ($IPAddress !~ /^$IPRange/) {
|
||||||
$query = "($query) not Suppress=1";
|
if ( $query_type eq 'pqf' ) {
|
||||||
|
$query = "($query) && -(suppress:1)";
|
||||||
|
} else {
|
||||||
|
$query = "($query) not Suppress=1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$query = "($query) not Suppress=1";
|
if ( $query_type eq 'pqf' ) {
|
||||||
|
$query = "($query) && -(suppress:1)";
|
||||||
|
} else {
|
||||||
|
$query = "($query) not Suppress=1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue