[Koha-patches] [PATCH] Bug 8947: XSLT fallback logic backwards

Jared Camins-Esakov jcamins at cpbibliography.com
Fri Oct 19 14:36:14 CEST 2012


The logic for the XSLT fallback was backwards, which meant that
non-English installations of the CCSR theme were unable to use XSLT
stylesheets. This patch corrects the logic.

To test:
1) Switch to the ccsr OPAC theme.
2) Switch to a language other than English for the OPAC.
3) Turn on the default XSLT stylesheets for the OPAC.
4) Do a search or view a record that would result in something being
   displayed with XSLT. This will work after the patch, but not before.
---
 C4/XSLT.pm |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/C4/XSLT.pm b/C4/XSLT.pm
index d17b828..19ec162 100644
--- a/C4/XSLT.pm
+++ b/C4/XSLT.pm
@@ -166,9 +166,9 @@ sub XSLTParse4Display {
                        "slim2OPACResults.xsl";
         }
         $xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile";
-        $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && !-f $xslfilename );
-        $xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( !-f $xslfilename );
-        $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && !-f $xslfilename );
+        $xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
+        $xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( -f $xslfilename );
+        $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename );
     }
 
     if ( $xslfilename =~ m/\{langcode\}/ ) {
-- 
1.7.9.5


More information about the Koha-patches mailing list