From 89c3fb67a57e5d883091894986b45f306d698d11 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 26 Apr 2013 17:11:37 +0100 Subject: [PATCH] Bug 9684 : Correct path to compact.xsl When try to display card view of retrieved record error occurred as compact.xsl could not be found script was constructing path as though it was opac Also added fallback to en version if no xsl file found under current lang as done in opac-showmarc.pl --- catalogue/showmarc.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 1c453c4..0ee70c5 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -52,10 +52,13 @@ else { } if($view eq 'card') { - my $themelang = '/' . C4::Context->preference("opacthemes") . '/' . C4::Templates::_current_language(); + my $themelang = '/' . C4::Templates::_current_language(); my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); my $xslfile = - C4::Context->config('intrahtdocs') . $themelang . "/xslt/compact.xsl"; + C4::Context->config('intrahtdocs') . '/prog' . $themelang . "/xslt/compact.xsl"; + if ( ! -f $xslfile && $themelang ne '/en' ) { + $xslfile=~s#$themelang#/en#; + } my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); -- 1.8.2.135.g7b592fa