From f960091011378ffd5f8cbbb407a31514abad90bd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 3 Oct 2016 12:27:21 +0100 Subject: [PATCH] Bug 17278: Fix "show all items" link Then we need to remove the "available" part from the query. They are really awkward patches... Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize Signed-off-by: Martin Renvoize Signed-off-by: Mason James (cherry picked from commit 1a27bd10dabe4905c115d4caf7ea566b2a19c073) Signed-off-by: Julian Maurice --- C4/Search.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Search.pm b/C4/Search.pm index 19277d2232..d84d34e78b 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1482,6 +1482,10 @@ sub buildQuery { # this happens when selecting a subject on the opac-detail page @limits = grep {!/^$/} @limits; my $original_q = $q; # without available part + unless ( grep { /^available$/ } @limits ) { + $q =~ s| and \( \( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:''\) and \(lost,st-numeric=0\) \)||; + $original_q = $q; + } if ( @limits ) { if ( grep { /^available$/ } @limits ) { $q .= q| and ( ( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:'') and (lost,st-numeric=0) )|; -- 2.39.5