LP#2004420: Quiet various warning logs.
authorChris Sharp <csharp@georgialibraries.org>
Mon, 30 Jan 2023 18:03:42 +0000 (13:03 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 31 Jan 2023 19:47:13 +0000 (14:47 -0500)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm
Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm

index da0c9d7..5c0e603 100644 (file)
@@ -586,7 +586,7 @@ sub update_patron {
                 'au.barred' : 'au.unbarred';
         }
 
-        if($old_patron->photo_url ne $new_patron->photo_url) {
+        if($old_patron->photo_url && $old_patron->photo_url ne $new_patron->photo_url) {
             my $perm = 'UPDATE_USER_PHOTO_URL';
             return $e->die_event unless $e->allowed($perm, $patron->home_ou);
         }
@@ -1581,7 +1581,7 @@ sub patron_adv_search {
     return ($fleshed ? undef : []) unless (ref $search_hash ||'') eq 'HASH';
     my $search_ok = 0;
     for my $key (keys %$search_hash) {
-        next if $search_hash->{$key}{value} =~ /^\s*$/; # empty filter
+        next if !$search_hash->{$key}{value} ||  $search_hash->{$key}{value} =~ /^\s*$/; # empty filter
         $search_ok = 1;
         last;
     }
index 6a7044c..c72072c 100644 (file)
@@ -327,7 +327,7 @@ sub can_close_circ {
     # checked in or renewed.
     if ($circ->checkin_time) {
         $can_close = 1;
-    } elsif ($reason eq OILS_STOP_FINES_LOST) {
+    } elsif ($reason && $reason eq OILS_STOP_FINES_LOST) {
         # Check the copy circ_lib to see if they close
         # transactions when lost are paid.
         my $copy = $e->retrieve_asset_copy($circ->target_copy);
@@ -341,7 +341,7 @@ sub can_close_circ {
             );
         }
 
-    } elsif ($reason eq OILS_STOP_FINES_LONGOVERDUE) {
+    } elsif ($reason && $reason eq OILS_STOP_FINES_LONGOVERDUE) {
         # Check the copy circ_lib to see if they close
         # transactions when long-overdue are paid.
         my $copy = $e->retrieve_asset_copy($circ->target_copy);
index 8d34d7c..a5d700d 100644 (file)
@@ -688,8 +688,8 @@ sub filter_user_copy_alerts {
         foreach my $a (@$alerts) {
             # filter on event type
             if (defined $a->alert_type) {
-                next if ($a->alert_type->event eq 'CHECKIN' && !$self->is_checkin && !$self->is_renewal);
-                next if ($a->alert_type->event eq 'CHECKOUT' && !$self->is_checkout && !$self->is_renewal);
+                next if (defined $a->alert_type->event && $a->alert_type->event eq 'CHECKIN' && !$self->is_checkin && !$self->is_renewal);
+                next if (defined $a->alert_type->event && $a->alert_type->event eq 'CHECKOUT' && !$self->is_checkout && !$self->is_renewal);
                 next if (defined $a->alert_type->in_renew && $U->is_true($a->alert_type->in_renew) && !$self->is_renewal);
                 next if (defined $a->alert_type->in_renew && !$U->is_true($a->alert_type->in_renew) && $self->is_renewal);
             }
index 7cfc168..46262ec 100644 (file)
@@ -494,7 +494,7 @@ sub make_payments {
         }
 
         # Urgh, clean up this mega-function one day.
-        if ($cc_processor eq 'Stripe' and $approval_code and $cc_payload) {
+        if ($cc_processor && $cc_processor eq 'Stripe' and $approval_code and $cc_payload) {
             $payment->cc_number($cc_payload->{card}); # not actually available :)
         }
 
index 9a27159..2ef6ba4 100644 (file)
@@ -2147,7 +2147,7 @@ __PACKAGE__->register_method(
 sub copy_counts_per_org {
     my( $self, $client, $record_id ) = @_;
 
-    warn "Retreiveing copy copy counts for record $record_id and method " . $self->api_name . "\n";
+    #warn "Retreiveing copy copy counts for record $record_id and method " . $self->api_name . "\n";
 
     my $method = "open-ils.storage.biblio.record_entry.global_copy_count.atomic";
     if($self->api_name =~ /staff/) { $method =~ s/atomic/staff\.atomic/; }
index 743abcd..859d960 100644 (file)
@@ -279,7 +279,9 @@ sub do_class_search {
                 push @results, $res->{result}; 
                 push @connections, $res->{connection}; 
 
-                $logger->debug("z3950: Result object: $results[$i], Connection object: $connections[$i]");
+                if ($results[$i] && $connections[$i]) {
+                       $logger->debug("z3950: Result object: $results[$i], Connection object: $connections[$i]");
+               }
             } 
         }
 
index dab85c0..75ffdf7 100644 (file)
@@ -160,11 +160,14 @@ sub log {
 # -----------------------------------------------------------------------------
 sub checkauth {
     my $self = shift;
-    $self->log(D, "checking auth token ".$self->authtoken);
+    my $content;
+    if ( $self->authtoken ) {
+        $self->log(D, "checking auth token ".$self->authtoken);
 
-    my $content = $U->simplereq( 
-        'open-ils.auth', 
-        'open-ils.auth.session.retrieve', $self->authtoken, 1);
+        $content = $U->simplereq( 
+            'open-ils.auth', 
+            'open-ils.auth.session.retrieve', $self->authtoken, 1);
+    }
 
     if(!$content or $U->event_code($content)) {
         $self->event( ($content) ? $content : OpenILS::Event->new('NO_SESSION'));