Bug 35171: Add send_empty option to runreport
authorNick Clemens <nick@bywatersolutions.com>
Thu, 26 Oct 2023 18:03:40 +0000 (18:03 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 8 Nov 2023 08:42:43 +0000 (22:42 -1000)
commit42fdb17d683f4d998f74e8f2aec6d9a8d97e8d4c
tree83890e0949968c44a78b84d9e017b7ae036a8f9e
parentbaf56d81b73a7bf4ad8559fb654059c9149bd4d9
Bug 35171: Add send_empty option to runreport

This patch adds a new 'send_empty' option to runreport.pl

To test:
1 - Create a report in Koha that will not return any results:
    SELECT barcode FROM items WHERE 1=2
2 - perl misc/cronjobs/runreport.pl 1
3 - Output is: NO OUTPUT: 0 results from execute_query
4 - perl misc/cronjobs/runreport.pl 1 --send_empty
5 - Output is: no results were returned for the report
6 - perl misc/cronjobs/runreport.pl 1 --send_empty --email
7 - It will die on an email error unless you have SMTP configured - this si good, it means we sent an email
8 - Bonus points: Test on a system that can correctly send emails, confirm it works :-)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4bfd1e21c6ff2415c8e36ec2e376ca1c1330fbb2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
misc/cronjobs/runreport.pl