[open-ils-commits] r16774 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jun 22 10:51:28 EDT 2010
Author: erickson
Date: 2010-06-22 10:51:26 -0400 (Tue, 22 Jun 2010)
New Revision: 16774
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm
Log:
added warnings for missing params to MinPassiveTargetAge validator; missing params results in invalid for all target objects (noop_false)
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm 2010-06-22 14:51:25 UTC (rev 16773)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm 2010-06-22 14:51:26 UTC (rev 16774)
@@ -29,6 +29,16 @@
my $target = $env->{target};
my $delay_field = $env->{params}->{target_age_field} || $env->{event}->event_def->delay_field;
+ unless($env->{params}->{min_target_age}) {
+ $logger->warn("'min_target_age' parameter required for MinPassiveTargetAge validator");
+ return 0; # no-op false
+ }
+
+ unless($delay_field) {
+ $logger->warn("'target_age_field' parameter or delay_field required for MinPassiveTargetAge validator");
+ return 0; # no-op false
+ }
+
my $delay_field_ts = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($target->$delay_field()));
# to get the minimum time that the target must have aged to, add the min age to the delay field
More information about the open-ils-commits
mailing list