From 87ec4126484d5c55efd66b359220934d3501ff6c Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Thu, 24 Feb 2011 16:33:38 -0500 Subject: [PATCH] Bug 4852 - rewrite the query to include limits if using ccl= Signed-off-by: Jared Camins-Esakov Signed-off-by: Chris Cormack --- C4/Search.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index a4699487a9..45ebb24b03 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1043,7 +1043,13 @@ sub buildQuery { # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps # DIAGNOSTIC ONLY!! if ( $query =~ /^ccl=/ ) { - return ( undef, $', $', "q=ccl=$'", $', '', '', '', '', 'ccl' ); + my $q=$'; + # This is needed otherwise ccl= and &limit won't work together, and + # this happens when selecting a subject on the opac-detail page + if (@limits) { + $q .= ' and '.join(' and ', @limits); + } + return ( undef, $q, $q, "q=ccl=$q", $q, '', '', '', '', 'ccl' ); } if ( $query =~ /^cql=/ ) { return ( undef, $', $', "q=cql=$'", $', '', '', '', '', 'cql' ); -- 2.39.5