From e949eba409338efc68432fb47c8f9c9902679c78 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 4 Aug 2014 10:56:34 +0200 Subject: [PATCH] Bug 12031: [QA Follow-up] Undefined routine and change to koha-conf.xml [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 Tested single and dev install for supportdir change. Compared installations with and without the patches for this report. Signed-off-by: Tomas Cohen Arazi --- 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 c7600b00e5..499172cb2e 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 c886050539..6f2f8a816b 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -106,11 +106,9 @@ __PAZPAR2_TOGGLE_XML_POST__ tool --> 0 0 - + http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2 __MISC_DIR__/koha-install-log diff --git a/rewrite-config.PL b/rewrite-config.PL index 87e2587cc1..8e6813de57 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 c6715b88cc..c909971188 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 ); } } -- 2.39.2