From 4309e5e6b4682b95db4ca26f7a49f96c2f6c2875 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 19 Aug 2013 18:22:00 +0000 Subject: [PATCH] Bug 10766: unbreak reservoir search when UseQueryParser is OFF To test: [1] Turn UseQueryParser off. [2] Ensure that your database has records in the reservoir. Performing a Z39.50 search will do this. [3] Perform a broad cataloging (i.e., cataloguing/addbooks.pl search). Note that results are returned from the main catalog but that no reservoir results are returned. [4] Apply the patch. [5] Perform the search again. This time, there should be both catalog and reservoir results. [7] Enable QueryParser. Perform the search again, and verify that the catalog and reservoir results are the same. Signed-off-by: Galen Charlton Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Patch works nicely, passes all tests, and the QA script. Signed-off-by: Galen Charlton --- cataloguing/addbooks.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index f643599635..b22a6469ff 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -73,9 +73,12 @@ if ($query) { my $QParser; $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser')); - unless ($QParser) { - my ( $builterror,$builtquery,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(undef,\@operands); - $query = $builtquery; + my $builtquery; + if ($QParser) { + $builtquery = $query; + } else { + my ( $builterror,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type); + ( $builterror,$builtquery,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(undef,\@operands); } # find results -- 2.39.5