From: Colin Campbell Date: Fri, 26 Apr 2013 16:11:37 +0000 (+0100) Subject: Bug 9684 : Correct path to compact.xsl X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=5b6f89714d58d4a7c33b621b2cefbc02523dafa3;p=koha.git 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 Signed-off-by: Nicole C. Engard Test plan: * Set sys pref to use CCSR * Do a Z39.50 Search * Click 'card' on one of the results * confirm that there is no error. All test pass Signed-off-by: Katrin Fischer I am astonished that opacthemes affects Z39.50 search in staff so this might be fixing a bigger problem. Checked that clicking on Card works for both themes now correctly after I confirmed the bug. Also all views in OPAC were checked for both themes. All tests and QA script pass. Signed-off-by: Jared Camins-Esakov --- diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 1c453c4d13..0ee70c5fea 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);