Can't use 0 in true/false, use defined instead
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 5 Jul 2011 21:13:05 +0000 (17:13 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 6 Jul 2011 13:06:07 +0000 (09:06 -0400)
This allows for setting renewals/grace period to 0 by force

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 2d42704..cbdb4fc 100644 (file)
@@ -1174,11 +1174,11 @@ sub run_indb_circ_test {
         $logger->info("circulator: circ policy test found matchpoint built via rows " . $results->[0]->{buildrows});
         $self->circ_matrix_matchpoint($self->editor->retrieve_config_circ_matrix_matchpoint($mp));
         $self->circ_matrix_matchpoint->duration_rule($self->editor->retrieve_config_rules_circ_duration($results->[0]->{duration_rule}));
-        if($results->[0]->{renewals}) {
+        if(defined($results->[0]->{renewals})) {
             $self->circ_matrix_matchpoint->duration_rule->max_renewals($results->[0]->{renewals});
         }
         $self->circ_matrix_matchpoint->recurring_fine_rule($self->editor->retrieve_config_rules_recurring_fine($results->[0]->{recurring_fine_rule}));
-        if($results->[0]->{grace_period}) {
+        if(defined($results->[0]->{grace_period})) {
             $self->circ_matrix_matchpoint->recurring_fine_rule->grace_period($results->[0]->{grace_period});
         }
         $self->circ_matrix_matchpoint->max_fine_rule($self->editor->retrieve_config_rules_max_fine($results->[0]->{max_fine_rule}));