@@ -, +, @@ --- C4/Search.pm | 4 ++++ 1 file changed, 4 insertions(+) --- a/C4/Search.pm +++ a/C4/Search.pm @@ -1477,6 +1477,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) )|; --