From 2f2507e6bf88a3e01c662d1149f4b9282bf0ff6f Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 19 Jul 2018 16:39:32 +0200 Subject: [PATCH] Bug 21101: Rename engine var in C4::XSLT 'engine' is both a method, used outisde module, and a module shared variable. I rename the variable 'xslth' to avoid confusion and use 'engine()' method inside the module. --- C4/XSLT.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index bf2647ab74..6689aba469 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -38,7 +38,7 @@ use Encode; use vars qw(@ISA @EXPORT); -my $engine; #XSLT Handler object +my $xslth; #XSLT Handler object my %authval_per_framework; # Cache for tagfield-tagsubfield to decode per framework. # Should be preferably be placed in Koha-core... @@ -48,8 +48,9 @@ BEGIN { @ISA = qw(Exporter); @EXPORT = qw( &XSLTParse4Display + &engine ); - $engine=Koha::XSLT_Handler->new( { do_not_return_source => 1 } ); + $xslth=Koha::XSLT_Handler->new( { do_not_return_source => 1 } ); } =head1 NAME @@ -255,7 +256,7 @@ sub XSLTParse4Display { #If the xslt should fail, we will return undef (old behavior was #raw MARC) #Note that we did set do_not_return_source at object construction - return $engine->transform($xmlrecord, $xslfilename ); #file or URL + return engine()->transform($xmlrecord, $xslfilename ); #file or URL } =head2 buildKohaItemsNamespace @@ -349,7 +350,7 @@ Returns reference to XSLT handler object. =cut sub engine { - return $engine; + return $xslth; } 1; -- 2.17.1