[open-ils-commits] [GIT] Evergreen ILS branch master updated. 22813f800eaaea6037507f36eaff8bd55127a2eb

Evergreen Git git at git.evergreen-ils.org
Tue Aug 23 14:28:29 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  22813f800eaaea6037507f36eaff8bd55127a2eb (commit)
      from  42a818eff95d3f9eef9015d66f7e1d5936c74118 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 22813f800eaaea6037507f36eaff8bd55127a2eb
Author: Liam Whalen <lwhalen at evergreen-dev.catalogue.nrcan.gc.ca>
Date:   Thu Aug 11 14:36:19 2011 -0400

    Fixed seaching for a colon (:) surrounded by white space
    
    When searching for a colon surrounded by white space the search would
    freeze.  An example of such a search would be:
    Climate change economics and policy : an RFF anthology
    This was happening because the decompose function within QueryParser.pm
    Would build a regular expression that would search the query for both
    classes and class aliases e.g (keyword and kw).  However, when buliding
    the regex for aliases QueryParser would add extraneous or symbols (|)
    to the end of the regex without adding the accompanying alias.
    This was happening because there was a check to see if the corresponding
    class to each alias had already been added to the regex.  But, the
    check to see if the alias had already been appened to the regex happened
    too late.  I have moved the check to encopase the appending of the or
    symbols and the class.
    Signed-off-by: Liam Whalen <lwhalen at evergreen-dev.catalogue.nrcan.gc.ca>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
index 1b3a37f..db9dd98 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm
@@ -497,11 +497,13 @@ sub decompose {
             s/(^|[^|])\b$alias[:=]/$1$class:/g;
         }
 
-        $search_class_re .= '|' unless ($first_class);
-        $first_class = 0;
+        if (!$seen_classes{$class}) {
+            $search_class_re .= '|' unless ($first_class);
+            $first_class = 0;
 
-        $search_class_re .= $class . '(?:\|\w+)*' if (!$seen_classes{$class});
-        $seen_classes{$class} = 1;
+            $search_class_re .= $class . '(?:\|\w+)*';
+            $seen_classes{$class} = 1;
+        }
     }
     $search_class_re .= '):';
 

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Storage/QueryParser.pm |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list