From: Bill Erickson Date: Thu, 22 Sep 2011 14:20:27 +0000 (-0400) Subject: Tpac: better param array detection in mkurl() X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5e134e4975fc674a2adfd3e893f2eba49a7bc292;p=evergreen%2Fpines.git Tpac: better param array detection in mkurl() Avoid propagating empty arrays as "ARRAY(JUNK)" Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/opac/parts/header.tt2 b/Open-ILS/src/templates/opac/parts/header.tt2 index 66e47ac7c0..e6addc88c1 100644 --- a/Open-ILS/src/templates/opac/parts/header.tt2 +++ b/Open-ILS/src/templates/opac/parts/header.tt2 @@ -43,7 +43,9 @@ # apply user params FOR k IN params.keys; encoded = []; - list = params.$k.0 ? params.$k : [params.$k]; + max = params.$k.max; + list = (params.$k.0 OR max == -1) ? params.$k : [params.$k]; + IF list.size == 0; NEXT; END; # CGI croaks on already-decoded strings. force-encode to be safe. FOR p IN list; encoded.push(ctx.encode_utf8(p)); END; foo = cgi.param("-name", k, "-values", encoded);