Bugzilla – Attachment 8218 Details for
Bug 7721
Global xslt parsing in XSLT.pm under mod_perl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix the problem
0001-Met-un-cache-pour-chaque-xsl-ce-qui-r-gle-le-probl-m.patch (text/plain), 3.31 KB, created by
Maxime Pelletier
on 2012-03-15 20:20:33 UTC
(
hide
)
Description:
patch to fix the problem
Filename:
MIME Type:
Creator:
Maxime Pelletier
Created:
2012-03-15 20:20:33 UTC
Size:
3.31 KB
patch
obsolete
>From 18545e3f9be7ea0e5beca23d95349e5924ec7720 Mon Sep 17 00:00:00 2001 >From: Maxime Pelletier <maxime.pelletier@libeo.com> >Date: Thu, 15 Mar 2012 15:28:03 -0400 >Subject: [PATCH 1/2] =?UTF-8?q?Met=20un=20cache=20pour=20chaque=20xsl=20ce=20qui=20r=C3=A8gle=20le=20probl=C3=A8me=20que=20ca=20mettait=20le=20premier=20xls=20du=20bord=20dans=20le=20cache=20et=20affichait=20de=20temps=20en=20temps=20le=20mauvais=20sous=20mod=5Fperl?= >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >--- > C4/XSLT.pm | 44 ++++++++++++++++++++++---------------------- > 1 files changed, 22 insertions(+), 22 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 8bc4000..2857a09 100755 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -118,8 +118,7 @@ sub getAuthorisedValues4MARCSubfields { > return $authval_per_framework{ $frameworkcode }; > } > >-my $stylesheet; >- >+my %stylesheet; > sub XSLTParse4Display { > my ( $biblionumber, $orig_record, $xsl_suffix, $interface, $fixamps ) = @_; > $interface = 'opac' unless $interface; >@@ -153,29 +152,30 @@ sub XSLTParse4Display { > # don't die when you find &, >, etc > $parser->recover_silently(0); > my $source = $parser->parse_string($xmlrecord); >- unless ( $stylesheet ) { >+ my $xslfile; >+ if ($interface eq 'intranet') { >+ $xslfile = C4::Context->config('intrahtdocs') . >+ '/' . C4::Context->preference("template") . >+ '/' . C4::Templates::_current_language() . >+ '/xslt/' . >+ C4::Context->preference('marcflavour') . >+ "slim2intranet$xsl_suffix.xsl"; >+ } else { >+ $xslfile = C4::Context->config('opachtdocs') . >+ '/' . C4::Context->preference("opacthemes") . >+ '/' . C4::Templates::_current_language() . >+ '/xslt/' . >+ C4::Context->preference('marcflavour') . >+ "slim2OPAC$xsl_suffix.xsl"; >+ } >+ unless ( $stylesheet{$xslfile} ) { #No cached stylesheet > my $xslt = XML::LibXSLT->new(); >- my $xslfile; >- if ($interface eq 'intranet') { >- $xslfile = C4::Context->config('intrahtdocs') . >- '/' . C4::Context->preference("template") . >- '/' . C4::Templates::_current_language() . >- '/xslt/' . >- C4::Context->preference('marcflavour') . >- "slim2intranet$xsl_suffix.xsl"; >- } else { >- $xslfile = C4::Context->config('opachtdocs') . >- '/' . C4::Context->preference("opacthemes") . >- '/' . C4::Templates::_current_language() . >- '/xslt/' . >- C4::Context->preference('marcflavour') . >- "slim2OPAC$xsl_suffix.xsl"; >- } > my $style_doc = $parser->parse_file($xslfile); >- $stylesheet = $xslt->parse_stylesheet($style_doc); >+ $stylesheet{$xslfile} = $xslt->parse_stylesheet($style_doc); > } >- my $results = $stylesheet->transform($source); >- my $newxmlrecord = $stylesheet->output_string($results); >+ my $parsed_stylesheet = $stylesheet{$xslfile}; >+ my $results = $parsed_stylesheet->transform($source); >+ my $newxmlrecord = $parsed_stylesheet->output_string($results); > return $newxmlrecord; > } > >-- >1.7.2.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7721
: 8218