Protect against empty lists of linked bib searches
authorberick <berick@esilibrary.com>
Thu, 26 May 2011 18:44:48 +0000 (14:44 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 11 Jul 2011 17:48:28 +0000 (13:48 -0400)
Instead of returning undef when passed an empty list of bibs, always
return an array from
open-ils.cat.authority.records.count_linked_bibs
Apart from consistency, this prevents JS errors in the Manage
Authorities UI.

Signed-off-by: berick <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/Authority.pm

index 1995edf..9e60557 100644 (file)
@@ -194,7 +194,7 @@ sub count_linked_bibs {
 
     my $editor = new_editor();
 
-    my $link_count;
+    my $link_count = [];
     my @clean_records;
     for my $auth ( @$records ) {
         # Protection against SQL injection? Might be overkill.