https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32560 --- Comment #10 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 147814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147814&action=edit Bug 32560: (follow-up) Replace raw SQL queries with Koha::Patrons search and update Also: - Add use Koha::Script -cron; - Add license - Add optional verbose flag - Add cronjob logging Test plan: 1. Set 'CronjobLog' syspref = 'Log' 2. Edit a borrower to have an expiration date in the past - also make sure they have 'Lost card' set to 'No' 3. Run the set_expired_lost.pl script: sudo koha-shell <instance> cd misc/cronjobs ./set_expired_lost.pl 4. Observe no output is displayed but viewing the borrower account from step #1 they now have a 'Lost card' value of 'Yes'. 5. Change the borrower account 'Lost card' back to 'No' 6. Run the set_expired_lost.pl script again, this time with the verbose flag: sudo koha-shell <instance> cd misc/cronjobs ./set_expired_lost.pl -v 7. Observe output is displayed to the commandline showing the number of borrowers that have been changed. Check the borrower account again and notice the 'Lost card' has been set back to 'Yes'. 8. Repeat step #6 and observe no output is printed to the terminal - this is because all expired borrowers have already been marked as lost. 9. Check there are log entries for set_expired_lost.pl cronjob in the action_logs table: sudo koha-mysql <instance> select * from action_logs where script='set_expired_lost.pl'; Sponsored-by: Dalton McCaughey Library, Australia -- You are receiving this mail because: You are watching all bug changes.