https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30666
Marcel de Rooy <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134565|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <[email protected]> --- Created attachment 134959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134959&action=edit Bug 30666: Holds reminder cronjob (holds_reminder.pl) uses DataTime::subtract wrong In holds_reminder.pl, the script loops over all available branchcodes. For each iteration of the loop, if not using the calendar, the script subtracts the days parameter from the current date to get the waiting date threshold. The problem is that this method alters the DateTime object in $date_to_run, so for each iteration of the loop, the waiting date becomes farther and farther in the past, when it should always be the same! The solution is to either clone the "date to run" for each call to subtract, or to move it out of the loop since it doesn't need to be recalculated each time. Test Plan: 1) Become the koha user using koha-shell 2) Run DBIC_TRACE=1 misc/cronjobs/holds/holds_reminder.pl --days 7 3) Note in the queries that for each loop, the waiting date is different 4) Apply this patch 5) Run the command in step 2 again 6) Note the queries all now have the same waiting date threshold! Signed-off-by: David Nind <[email protected]> Signed-off-by: Marcel de Rooy <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
