Bugzilla – Attachment 30529 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: [QA Follow-up] Undefined routine and change to koha-conf.xml
Bug-12031-QA-Follow-up-Undefined-routine-and-chang.patch (text/plain), 5.10 KB, created by
Marcel de Rooy
on 2014-08-04 12:13:48 UTC
(
hide
)
Description:
Bug 12031: [QA Follow-up] Undefined routine and change to koha-conf.xml
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-08-04 12:13:48 UTC
Size:
5.10 KB
patch
obsolete
>From 2f98e5f6af67600e92bf6454fd88caf0526f767c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 4 Aug 2014 10:56:34 +0200 >Subject: [PATCH] Bug 12031: [QA Follow-up] Undefined routine and change to > koha-conf.xml >Content-Type: text/plain; charset=utf-8 > >[1] Routine add_cron_job was added in 2007 but has not been defined. > Parameter Recurring is not used. >[2] Made some changes to koha-conf.xml. Instead of an example to edit, > I replaced it by the SCRIPT_NONDEV_DIR install variable. >[3] SCRIPT_NONDEV_DIR had to be included in rewrite-config.pl and the > path had to be corrected for dev installs in Makefile.PL > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested single and dev install for supportdir change. >Compared installations with and without the patches for this report. >--- > Makefile.PL | 4 +++- > etc/koha-conf.xml | 8 +++----- > rewrite-config.PL | 1 + > tools/scheduler.pl | 29 ++++++++++++++++------------- > 4 files changed, 23 insertions(+), 19 deletions(-) > >diff --git a/Makefile.PL b/Makefile.PL >index c7600b0..499172c 100644 >--- a/Makefile.PL >+++ b/Makefile.PL >@@ -1259,7 +1259,9 @@ sub get_target_directories { > $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2'); > $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); > $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); >- $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'}; >+ #For dev install, point NONDEV_DIR to misc in current dir (not base) >+ #Used by supportdir in koha-conf.xml (BZ 12031) >+ $dirmap{'SCRIPT_NONDEV_DIR'} = File::Spec->catdir($curdir, 'misc'); > $skipdirs{'SCRIPT_NONDEV_DIR'} = 1; > $dirmap{'MAN_DIR'} = File::Spec->catdir(@basedir, $package, 'man'); > $dirmap{'DOC_DIR'} = File::Spec->catdir(@basedir, $package, 'doc'); >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 6d19601..a47fd29 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -106,11 +106,9 @@ __PAZPAR2_TOGGLE_XML_POST__ > tool --> > <backup_db_via_tools>0</backup_db_via_tools> > <backup_conf_via_tools>0</backup_conf_via_tools> >- <!-- Uncomment the following line if you are not using packages and need to schedule reports through the web interface >- Example: >- My runreports.pl is in /home/user/koha-src/koha/misc/cronjobs >- my <supportdir> would be as follows: >- <supportdir>/home/user/koha-src/koha/misc</supportdir> >+ <!-- Uncomment the following line if you are not using packages and need to schedule reports through the web interface. supportdir should contain cronjobs/runreport.pl --> >+ <!-- >+ <supportdir>__SCRIPT_NONDEV_DIR__</supportdir> > --> > <pazpar2url>http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2</pazpar2url> > <install_log>__MISC_DIR__/koha-install-log</install_log> >diff --git a/rewrite-config.PL b/rewrite-config.PL >index 87e2587..8e6813d 100644 >--- a/rewrite-config.PL >+++ b/rewrite-config.PL >@@ -115,6 +115,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; > '__PAZPAR2_CONF_DIR__' => "$prefix/etc/koha/pazpar2", > '__MISC_DIR__' => "$prefix/misc", > '__SCRIPT_DIR__' => "$prefix/bin", >+ '__SCRIPT_NONDEV_DIR__' => "$prefix/bin", > '__MAN_DIR__' => "$prefix/man", > '__DOC_DIR__' => "$prefix/doc", > '__ZEBRA_LOCK_DIR__' => "$prefix/var/lock/zebradb", >diff --git a/tools/scheduler.pl b/tools/scheduler.pl >index c6715b8..c909971 100755 >--- a/tools/scheduler.pl >+++ b/tools/scheduler.pl >@@ -40,7 +40,7 @@ if ( C4::Context->config('supportdir') ) { > $base = C4::Context->config('supportdir'); > } > else { >- $base = "/usr/share/koha/bin"; >+ $base = "/usr/share/koha/bin"; > } > > my $CONFIG_NAME = $ENV{'KOHA_CONF'}; >@@ -68,24 +68,27 @@ if ( $mode eq 'job_add' ) { > my $startdate = join('', (split /-/, $c4date->output("iso"))); > > my $starttime = $input->param('starttime'); >- my $recurring = $input->param('recurring'); > $starttime =~ s/\://g; > my $start = $startdate . $starttime; > my $report = $input->param('report'); > my $format = $input->param('format'); > my $email = $input->param('email'); > my $command = >- "export KOHA_CONF=\"$CONFIG_NAME\"; " . $base >- . "/cronjobs/runreport.pl $report --format=$format --to=$email"; >- >- if ($recurring) { >- my $frequency = $input->param('frequency'); >- add_cron_job( $start, $command ); >- } >- else { >- unless ( add_at_job( $start, $command ) ) { >- $template->param( job_add_failed => 1 ); >- } >+ "export KOHA_CONF=\"$CONFIG_NAME\"; " . >+ "$base/cronjobs/runreport.pl $report --format=$format --to=$email"; >+ >+#FIXME commit ea899bc55933cd74e4665d70b1c48cab82cd1257 added recurring parameter (it is not in template) and call to add_cron_job (undefined) >+# my $recurring = $input->param('recurring'); >+# if ($recurring) { >+# my $frequency = $input->param('frequency'); >+# add_cron_job( $start, $command ); >+# } >+# else { >+# #here was the the unless ( add_at_job >+# } >+ >+ unless ( add_at_job( $start, $command ) ) { >+ $template->param( job_add_failed => 1 ); > } > } > >-- >1.7.7.6
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