[open-ils-commits] r19928 - branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Apr 1 15:30:40 EDT 2011


Author: erickson
Date: 2011-04-01 15:30:35 -0400 (Fri, 01 Apr 2011)
New Revision: 19928

Modified:
   branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Log:
Patch from Thomas Berezansky to address unneccessary fine generation and avoid unchecked division by zero; details and DCO at https://bugs.launchpad.net/evergreen/+bug/747533

Modified: branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm	2011-04-01 19:29:46 UTC (rev 19927)
+++ branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm	2011-04-01 19:30:35 UTC (rev 19928)
@@ -839,6 +839,12 @@
             $fine_interval =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o;
 			$fine_interval = interval_to_seconds( $fine_interval );
 	
+            if ( $fine_interval == 0 || int($c->$recurring_fine_method * 100) == 0 || int($c->max_fine * 100) == 0 ) {
+                $client->respond( "Fine Generator skipping circ due to 0 fine interval, 0 fine rate, or 0 max fine.\n" );
+                $log->info( "Fine Generator skipping circ " . $c->id . " due to 0 fine interval, 0 fine rate, or 0 max fine." );
+                next;
+            }
+
 			if ( $is_reservation and $fine_interval >= interval_to_seconds('1d') ) {	
 				my $tz_offset_s = 0;
 				if ($due_dt->strftime('%z') =~ /(-|\+)(\d{2}):?(\d{2})/) {



More information about the open-ils-commits mailing list