From a27fa0a92404f221fc2f976656a9f941a4e1fce2 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 22 Jun 2010 14:51:26 +0000 Subject: [PATCH] added warnings for missing params to MinPassiveTargetAge validator; missing params results in invalid for all target objects (noop_false) git-svn-id: svn://svn.open-ils.org/ILS/trunk@16774 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm index 2f35feba2..206ac102a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm @@ -29,6 +29,16 @@ sub MinPassiveTargetAge { 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 -- 2.11.0