Permalink
Browse files

[#10192207] Fix for fines script stalling on deleted items

If an item was checked out and deleted without being checked in,
a null itemnumber in the issues table made the fines script stop
processing without any alerts.  Any entries in the issues table
after the orphaned record did not accrue fines.  This adds a fix
to skip entries with null itemnumbers.
  • Loading branch information...
jwt01 authored and ctfliblime committed May 15, 2012
1 parent 28fbe62 commit 7e3e167972a10098aa2142e85821e078d8370a14
Showing with 4 additions and 0 deletions.
  1. +4 −0 misc/cronjobs/fines.pl
View
@@ -132,6 +132,10 @@ INIT
print STDERR "ERROR in Getoverdues line $i: issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n";
next; # Note: this doesn't solve everything. After NULL borrowernumber, multiple issues w/ real borrowernumbers can pile up.
}
+ unless (defined $data->[$i]->{'itemnumber'}) {
+ print STDERR "ERROR in Getoverdues line $i: issues.itemnumber IS NULL. Repair 'issues' table now! Skipping record.\n";
+ next; # Note: this doesn't solve everything. After NULL borrowernumber, multiple issues w/ real borrowernumbers can pile up.
+ }
# for legacy data that doesn't set issuingbranch:
$data->[$i]->{issuingbranch} ||= $data->[$i]->{branchcode};
my $borrower = BorType($data->[$i]->{'borrowernumber'});

0 comments on commit 7e3e167

Please sign in to comment.