Skip to content

Commit

Permalink
[#10192207] Fix for fines script stalling on deleted items
Browse files Browse the repository at this point in the history
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 Sep 13, 2012
1 parent 28fbe62 commit 7e3e167
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions misc/cronjobs/fines.pl
Expand Up @@ -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'});
Expand Down

0 comments on commit 7e3e167

Please sign in to comment.