From 6e142450ded7cbd00b4d1894a4c90fb7562ff01b Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Mon, 30 Jan 2023 13:03:42 -0500 Subject: [PATCH] LP#2004420: Quiet various warning logs. Signed-off-by: Chris Sharp --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm | 4 ++-- .../src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm | 4 ++-- .../src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 4 ++-- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm | 2 +- .../src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm | 4 +++- Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm | 11 +++++++---- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index da0c9d7fa2..5c0e60312f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -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; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm index 6a7044c769..c72072c87f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm @@ -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); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 8d34d7c84b..a5d700da3c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -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); } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm index 7cfc16821d..46262eca70 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm @@ -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 :) } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 9a27159e59..2ef6ba4342 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -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/; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm index 743abcd14b..859d96019d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm @@ -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]"); + } } } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm index dab85c0a19..75ffdf77e1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm @@ -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')); -- 2.11.0