[open-ils-commits] [GIT] Evergreen ILS branch master updated. 9ef0d32e369c0501746dd0cc3edfb81a7cecff43

Evergreen Git git at git.evergreen-ils.org
Tue Oct 11 11:47:13 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  9ef0d32e369c0501746dd0cc3edfb81a7cecff43 (commit)
      from  67a9cbcf7e20bd3711a7d207fa47fe4f68fe2e7d (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 9ef0d32e369c0501746dd0cc3edfb81a7cecff43
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Oct 11 11:33:28 2011 -0400

    TPac; repairs to advanced search query propagation
    
    In some cases, TPac will duplicate components of an advanced search
    query into the advanced search rows.  This patch fixes that with
    better array handling, particularly with CGI param search components
    that do not have corresponding analogs at a given array position (i.e.
    starting out with arrays of different sizes)
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
index 66ecea4..02aa5d1 100644
--- a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
+++ b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2
@@ -7,20 +7,14 @@
     ];
     contains = CGI.param('contains');
     queries = CGI.param('query');
-    bools = CGI.param('bool') || ['and' x 3];
-    qtypes = CGI.param('qtype') || ['keyword' x 3];
+    bools = CGI.param('bool');
+    qtypes = CGI.param('qtype');
+    rowcount = 3;
 
-    IF !qtypes.0; # not an array
-        qtypes = [qtypes];
-        bools = [bools];
-        queries = [queries];
-    END;
-
-    WHILE qtypes.size < 3;
-        qtypes.push('keyword');
-        bools.push('and');
-        queries.push('');
-    END;
+    # scalar.merge treats the scalar as a 1-item array
+    WHILE queries.size < rowcount; queries = queries.merge(['']); END;
+    WHILE bools.size < rowcount; bools = bools.merge(['and']); END;
+    WHILE qtypes.size < rowcount; qtypes = qtypes.merge(['keyword']); END;
 
     FOR qtype IN qtypes;
         c = contains.shift;

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

Summary of changes:
 .../templates/opac/parts/advanced/global_row.tt2   |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list