From 7e3e167972a10098aa2142e85821e078d8370a14 Mon Sep 17 00:00:00 2001 From: jwt01 Date: Tue, 15 May 2012 12:18:06 +0000 Subject: [PATCH] [#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. --- misc/cronjobs/fines.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl index 7075573394..9bed6e3fab 100755 --- a/misc/cronjobs/fines.pl +++ b/misc/cronjobs/fines.pl @@ -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'});