There is no occurrence of Date::Calc in tools/cleanborrowers.pl
Created attachment 130334 [details] [review] Bug 30042: Remove Date::Calc dependency in batch_anonymize.pl This patch makes the script use the Koha::DateUtils tools instead. To test: 1. Run: $ kshell k$ perl misc/cronjobs/batch_anonymise.pl --verbose --days 7 => SUCCESS: You see (the date may vary): Checkouts and holds before 2022-02-15 will be anonymised. 2. Apply this patch 3. Repeat 1 => SUCCESS: Same output 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Jonathan Druart from comment #1) > There is no occurrence of Date::Calc in tools/cleanborrowers.pl Right, sorry for that. I read 'the cronjob' on bug 29843 and jumped to file this one so we don't forget, but didn't check if the file was the right one.
Why this script and not all other occurrences then?
I still think this should be moved forward.
After the patch we add days instead of subtracting them.
Created attachment 140015 [details] [review] Bug 30042: Remove Date::Calc dependency in batch_anonymize.pl This patch makes the script use the Koha::DateUtils tools instead. To test: 1. Run: $ kshell k$ perl misc/cronjobs/batch_anonymise.pl --verbose --days 7 => SUCCESS: You see (the date may vary): Checkouts and holds before 2022-02-15 will be anonymised. 2. Apply this patch 3. Repeat 1 => SUCCESS: Same output 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(In reply to Joonas Kylmälä from comment #6) > After the patch we add days instead of subtracting them. How did that happen LOL. Fixed!
Created attachment 140016 [details] [review] Bug 30042: Remove Date::Calc dependency in batch_anonymize.pl This patch makes the script use the Koha::DateUtils tools instead. To test: 1. Run: $ kshell k$ perl misc/cronjobs/batch_anonymise.pl --verbose --days 7 => SUCCESS: You see (the date may vary): Checkouts and holds before 2022-02-15 will be anonymised. 2. Apply this patch 3. Repeat 1 => SUCCESS: Same output 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Created attachment 140175 [details] [review] Bug 30042: Remove Date::Calc dependency in batch_anonymize.pl This patch makes the script use the Koha::DateUtils tools instead. To test: 1. Run: $ kshell k$ perl misc/cronjobs/batch_anonymise.pl --verbose --days 7 => SUCCESS: You see (the date may vary): Checkouts and holds before 2022-02-15 will be anonymised. 2. Apply this patch 3. Repeat 1 => SUCCESS: Same output 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for upcoming 22.05.07 release
depends on bz29843, can't backport to 21.11.x
(In reply to Jonathan Druart from comment #4) > Why this script and not all other occurrences then? Yes, the title of this report is misleading.. git grep -l Date::Calc | wc -l 41