Bugzilla – Attachment 26847 Details for
Bug 12031
Task Scheduler not sending mail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12031 - Task scheduler not sending mail
Bug-12031---Task-scheduler-not-sending-mail.patch (text/plain), 3.10 KB, created by
Liz Rea
on 2014-04-06 22:01:04 UTC
(
hide
)
Description:
Bug 12031 - Task scheduler not sending mail
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2014-04-06 22:01:04 UTC
Size:
3.10 KB
patch
obsolete
>From 6751d02e4663e33c2e65a08540fb7afc35e132f6 Mon Sep 17 00:00:00 2001 >From: Liz Rea <liz@catalyst.net.nz> >Date: Mon, 7 Apr 2014 09:49:42 +1200 >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 and also corrects some path issues created by Debian packaging/Standard installs vs git installs > >Note: > >This patch makes it so that email sending is supported by default for package and standard debian tarball installs. For everyone else, if you specify a configuration option pointing to where your cronjobs are kept, in the form of > ><supportdir>/path/to/koha/misc</supportdir> > >task scheduling will be working in your install. > >Example: > >My runreports.pl is in /home/liz/koha-src/koha/misc/cronjobs > >my <supportdir> would be as follows: > ><supportdir>/home/liz/koha-src/koha/misc</supportdir> > >To test: > >1. make sure that your user is not in at.deny, and (if applicable/necessary) is in at.allow > >1a. set up your <supportdir> if required for your test installation type. > >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 (handy tip, if you schedule them a few days away you can see all of your tasks listed with the command used to invoke the job for comparison) > >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. > >8. add (or remove) your <supportdir> directive from your koha-conf.xml, schedule another task, note how the command is changed yet again. >--- > tools/scheduler.pl | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/tools/scheduler.pl b/tools/scheduler.pl >index 041aaf1..363f14c 100755 >--- a/tools/scheduler.pl >+++ b/tools/scheduler.pl >@@ -34,8 +34,15 @@ BEGIN { > } > > my $input = new CGI; >+my $base; >+ >+if ( C4::Context::->config('supportdir') ) { >+ $base = C4::Context->config('supportdir'); >+} >+else { >+ $base = "/usr/share/koha/bin"; >+} > >-my $base = C4::Context->config('intranetdir'); > my $CONFIG_NAME = $ENV{'KOHA_CONF'}; > > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >@@ -69,7 +76,7 @@ if ( $mode eq 'job_add' ) { > my $email = $input->param('email'); > my $command = > "export KOHA_CONF=\"$CONFIG_NAME\"; " . $base >- . "/bin/cronjobs/runreport.pl $report --format=$format --to=$email"; >+ . "/cronjobs/runreport.pl $report --format=$format --to=$email"; > > if ($recurring) { > my $frequency = $input->param('frequency'); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12031
:
26778
|
26802
|
26803
|
26847
|
26849
|
26850
|
26851
|
28783
|
29593
|
30452
|
30453
|
30527
|
30528
|
30529