Koha/misc/cronjobs
Kyle M Hall 84f7b7a7a3 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 <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-13 15:41:55 -10:00
..
holds Bug 30666: Holds reminder cronjob (holds_reminder.pl) uses DataTime::subtract wrong 2022-05-13 15:41:55 -10:00
recalls Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
rss
social_data
thirdparty
advance_notices.pl Bug 29698: Make items available for PREDUEDGST 2022-05-04 14:29:24 -10:00
archive_purchase_suggestions.pl
automatic_checkin.pl
automatic_item_modification_by_age.pl
automatic_renewals.pl Bug 30354: Don't assign warn as letter 2022-05-05 11:17:37 -10:00
backup.sh
batch_anonymise.pl Bug 29843: Use in batch_anonymise.pl 2022-02-10 14:44:23 -10:00
build_browser_and_cloud.pl
cart_to_shelf.pl
check-url-quick.pl
cleanup_database.pl
cloud-kw.pl
cloud-sample.conf
CONFIGURE.gmail
create_koc_db.pl
crontab.example Bug 19532: (QA follow-up) Add the cron jobs to the cron files 2022-03-14 22:45:52 -10:00
delete_items.pl
delete_patrons.pl
delete_records_via_leader.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
edi_cron.pl Bug 16258: (QA follow-up) Capitalise EDIFACT 2022-04-13 15:55:39 +02:00
fines.pl
gather_print_notices.pl Bug 29501: Use the default transport 2022-04-04 16:23:45 +02:00
import_webservice_batch.pl
longoverdue.pl
membership_expiry.pl
merge_authorities.pl
notice_unprocessed_suggestions.pl
overdue_notices.pl Bug 30132: Fix POD, show correct usage of Getopt::Long 2022-03-01 22:47:46 -10:00
patron_emailer.pl
plugins_nightly.pl
printoverdues.sh
process_message_queue.pl
purge_suggestions.pl
reconcile_balances.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
remove_temporary_edifiles.pl
runreport.pl Bug 26669: Last Run if report not always updated 2022-04-04 16:23:46 +02:00
serialsUpdate.pl
share_usage_with_koha_community.pl
sitemap.pl
staticfines.pl
stockrotation.pl
update_patrons_category.pl
update_totalissues.pl
writeoff_debts.pl