From 0fe988f8319a68c751a4376d70d2163ea9480515 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 9 Apr 2019 11:30:15 -0400 Subject: [PATCH] LP#1823983: repeat_delay check removes event definition id filter This bug has existed since the repeat_delay feature was added, but likely only rarely was triggered because most events don't have a repeat_delay, and those that do don't interact with the same target. However, as more repeatable event definitions are created, inappropriate interaction becomes more likely. In this commit we avoid overwriting the whole join condition clause, which already contains an event definition id filter and needs to retain it. Included is an unrelated change that uses the new-ish form of interval_to_seconds that avoids DST boundary shifting issues by passing a context DateTime object as the second parameter. Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm index 9027beb16c..0d9586e9ff 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm @@ -479,9 +479,9 @@ sub create_batch_events { } }}; if ($def->repeat_delay) { - $join->{'join'}{atev}{filter} = { start_time => { - '>' => DateTime->now->subtract( seconds => interval_to_seconds($def->repeat_delay) )->strftime( '%F %T%z' ) - } }; + $join->{'join'}{atev}{filter}{start_time} = { + '>' => DateTime->now->subtract( seconds => interval_to_seconds($def->repeat_delay, DateTime->now) )->strftime( '%F %T%z' ) + }; } push @{ $filter->{'-and'} }, { '+atev' => { id => undef } }; -- 2.11.0