From f86e6f5d2412b1cdca009954a654457a5bbb087f Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Thu, 2 Dec 2010 09:29:27 -0500 Subject: [PATCH] Bug 5457: gather_print_notices.pl requires explicit stylesheet 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 Signed-off-by: Chris Cormack (cherry picked from commit 31622bc6b3fe1f42d78c13c890ca2706dc41e86c) Signed-off-by: Chris Nighswonger --- misc/cronjobs/gather_print_notices.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 5e0c8634e2..03b65b4bba 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_contents .= $_ } -close STYLESHEET; +if ($stylesheet) { + open STYLESHEET, '<', $stylesheet; + while ( ) { $stylesheet_contents .= $_ } + close STYLESHEET; +} $template->param( stylesheet => $stylesheet_contents, -- 2.39.5