avoid adding site() to query if loc param is empty string
authorberick <berick@esilibrary.com>
Thu, 17 Mar 2011 20:22:31 +0000 (16:22 -0400)
committerberick <berick@esilibrary.com>
Thu, 17 Mar 2011 20:22:31 +0000 (16:22 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm

index 7a4d491..272a3fc 100644 (file)
@@ -78,7 +78,7 @@ sub _prepare_biblio_search {
     }
 
     my $site = $cgi->param('loc');
-    if (defined($site) and ($site ne $ctx->{aou_tree}->()->id) and not $query =~ /site\(\d+\)/) {
+    if (defined($site) and $site ne '' and ($site ne $ctx->{aou_tree}->()->id) and not $query =~ /site\(\d+\)/) {
         $query .= " site($site)";
     }
     if (defined($cgi->param('depth')) and not $query =~ /depth\(\d+\)/) {