Prevent uninit var warnings in Search/Biblio.pm
authorDan Scott <dscott@laurentian.ca>
Tue, 18 Jun 2013 16:17:40 +0000 (12:17 -0400)
committerBen Shum <bshum@biblio.org>
Tue, 18 Jun 2013 16:49:26 +0000 (12:49 -0400)
The logger messages in Search/Biblio.pm throw _many_ uninitialized
variable warnings. With a little care, we can prevent those warnings and
return our attention to more important log messages.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm

index 71a8563..c8b290d 100644 (file)
@@ -1384,7 +1384,10 @@ sub staged_search {
             if $page == 0;
 
         $logger->debug("staged search: located $current_count, with estimated hits=".
-            $summary->{estimated_hit_count}." : visible=".$summary->{visible}.", checked=".$summary->{checked});
+            ($summary->{estimated_hit_count} || "none") .
+            " : visible=" . ($summary->{visible} || "none") . ", checked=" .
+            ($summary->{checked} || "none")
+        );
 
         if (defined($summary->{estimated_hit_count})) {
             foreach (qw/ checked visible excluded deleted /) {
@@ -1618,7 +1621,9 @@ sub cache_staged_search_page {
     };
 
     $logger->info("staged search: cached with key=$key, superpage=$page, estimated=".
-        $summary->{estimated_hit_count}.", visible=".$summary->{visible});
+        ($summary->{estimated_hit_count} || "none") .
+        ", visible=" . ($summary->{visible} || "none")
+    );
 
     $cache->put_cache($key, $data, $cache_timeout);
 }