From 052076642e23bbf240f622f8f0022fdba55e3b1b Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Thu, 3 Apr 2014 14:49:16 +1300 Subject: [PATCH] Bug 12031 - Task Scheduler not sending mail At some stage the runreport.pl cronjob was changed to accept longopts, but the scheduler script wasn't changed along with it. This patch fixes the mismatch. To test: 1. make sure that your user is not in at.deny, and (if applicable/necessary) is in at.allow Useful, but not required step: make sure email can be sent from your server, also helpful is access to the Koha user's mail box (to see the bounce messages) 2. create a saved sql report to run 3. Go to Tools -> Task Scheduler and schedule a job to be run, and results emailed to you 4. note that you do not (without the patch) get an email. Make a note of the command it reports it is going to run. 5. apply the patch 6. schedule another job, you will notice that the command to run the scheduled job is slightly changed compared to the one in step 4. 7. Receiving an email when your job runs means the patch worked. Seeing --format= and --to= in the command also means the patch worked, as this is the command that runreport.pl is expecting. --- tools/scheduler.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scheduler.pl b/tools/scheduler.pl index 99210ac..eaa98d7 100755 --- a/tools/scheduler.pl +++ b/tools/scheduler.pl @@ -68,8 +68,8 @@ if ( $mode eq 'job_add' ) { my $format = $input->param('format'); my $email = $input->param('email'); my $command = - "EXPORT KOHA_CONF=\"$CONFIG_NAME\"; " . $base - . "/tools/runreport.pl $report $format $email"; + "export KOHA_CONF=\"$CONFIG_NAME\"; " . $base + . "/tools/runreport.pl $report --format=$format --to=$email"; if ($recurring) { my $frequency = $input->param('frequency'); -- 1.7.9.5