[open-ils-commits] r11824 - trunk/Open-ILS/src/extras
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jan 14 12:14:38 EST 2009
Author: dbs
Date: 2009-01-14 12:14:36 -0500 (Wed, 14 Jan 2009)
New Revision: 11824
Modified:
trunk/Open-ILS/src/extras/org_lasso_js.pl
Log:
Fix OrgLasso.js generation case where no search groups have been defined
Modified: trunk/Open-ILS/src/extras/org_lasso_js.pl
===================================================================
--- trunk/Open-ILS/src/extras/org_lasso_js.pl 2009-01-14 17:08:21 UTC (rev 11823)
+++ trunk/Open-ILS/src/extras/org_lasso_js.pl 2009-01-14 17:14:36 UTC (rev 11824)
@@ -26,9 +26,16 @@
{order_by => {lasso => 'name'}}
);
-print
- "var _lasso = [\n new lasso(" .
- join( "),\n new lasso(", map { OpenSRF::Utils::JSON->perl2JSON( bless($_, 'ARRAY') ) } @$lassos ) .
- ")\n]; /* Org Search Groups (Lassos) */ \n";
+# We need at least one defined search group; otherwise, just generate an empty array
+if (scalar(@$lassos) > 0) {
+ print
+ "var _lasso = [\n new lasso(" .
+ join( "),\n new lasso(", map { OpenSRF::Utils::JSON->perl2JSON( bless($_, 'ARRAY') ) } @$lassos ) .
+ ")\n]; /* Org Search Groups (Lassos) */ \n";
+} else {
+ print <<HERE;
+var _lasso = [
+]; /* Org Search Groups (Lassos) */
+HERE
+}
-
More information about the open-ils-commits
mailing list