Bug 10766: unbreak reservoir search when UseQueryParser is OFF
authorGalen Charlton <gmc@esilibrary.com>
Mon, 19 Aug 2013 18:22:00 +0000 (18:22 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 25 Aug 2013 17:16:23 +0000 (17:16 +0000)
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 <gmc@esilibrary.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Patch works nicely, passes all tests, and the QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
cataloguing/addbooks.pl

index f643599..b22a646 100755 (executable)
@@ -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