[Koha-patches] [PATCH] Bug 5457: gather_print_notices.pl requires explicit stylesheet

Nicole Engard nengard at bywatersolutions.com
Thu Dec 2 15:29:27 CET 2010


From: Ian Walls <ian.walls at bywatersolutions.com>

Adds a conditional around the opening and closing of STYLESHEET, testing on whether the $stylesheet variable is set
or not.

Signed-off-by: Nicole Engard <nengard at bywatersolutions.com>
---
 misc/cronjobs/gather_print_notices.pl |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl
index 5e0c863..03b65b4 100755
--- a/misc/cronjobs/gather_print_notices.pl
+++ b/misc/cronjobs/gather_print_notices.pl
@@ -73,9 +73,11 @@ open OUTPUT, '>', File::Spec->catdir( $output_directory, "holdnotices-" . $today
 my $template = C4::Output::gettemplate( 'batch/print-notices.tmpl', 'intranet', new CGI );
 my $stylesheet_contents = '';
 
-open STYLESHEET, '<', $stylesheet;
-while ( <STYLESHEET> ) { $stylesheet_contents .= $_ }
-close STYLESHEET;
+if ($stylesheet) {
+  open STYLESHEET, '<', $stylesheet;
+  while ( <STYLESHEET> ) { $stylesheet_contents .= $_ }
+  close STYLESHEET;
+}
 
 $template->param(
     stylesheet => $stylesheet_contents,
-- 
1.5.6.5



More information about the Koha-patches mailing list