'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);
}
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;
}
# 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);
);
}
- } 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);
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);
}
}
# 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 :)
}
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/; }
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]");
+ }
}
}
# -----------------------------------------------------------------------------
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'));