Bugzilla – Attachment 48963 Details for
Bug 15263
XSLT display fetches sysprefs for every result processed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15263: (follow-up) XSLT display fetches sysprefs for every result processed
Bug-15263-follow-up-XSLT-display-fetches-sysprefs-.patch (text/plain), 3.00 KB, created by
Jonathan Druart
on 2016-03-10 15:02:49 UTC
(
hide
)
Description:
Bug 15263: (follow-up) XSLT display fetches sysprefs for every result processed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-10 15:02:49 UTC
Size:
3.00 KB
patch
obsolete
>From 3de85f152b85f6136f7f66a09eb3fb102607f5b7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 10 Mar 2016 14:47:36 +0000 >Subject: [PATCH] Bug 15263: (follow-up) XSLT display fetches sysprefs for > every result processed > >Set variables ($sysxml, $xslfilename, $lang) if they are not passed to >the subroutine. This happens from catalogue/detail.pl, >opac/opac-shelves.pl, opac/opac-tags.pl and virtualshelves/shelves.pl. >--- > C4/Search.pm | 4 ++-- > C4/XSLT.pm | 10 ++++++---- > 2 files changed, 8 insertions(+), 6 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 2088586..31d7cca 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1867,7 +1867,7 @@ sub searchResults { > my $xslsyspref = $interface . "XSLTResultsDisplay"; > my $xslfile = C4::Context->preference($xslsyspref); > my $lang = C4::Languages::getlanguage(); >- my ($sysxml) = C4::XSLT::_get_xslt_sysprefs(); >+ my $sysxml = C4::XSLT::get_xslt_sysprefs(); > > # loop through all of the records we've retrieved > for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { >@@ -2199,7 +2199,7 @@ sub searchResults { > # XSLT processing of some stuff > # we fetched the sysprefs already before the loop through all retrieved record! > if (!$scan && $xslfile) { >- $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile); >+ $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); > # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs > } > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index eed1d09..7c91908 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -157,7 +157,7 @@ sub _get_best_default_xslt_filename { > return $xslfilename; > } > >-sub _get_xslt_sysprefs { >+sub get_xslt_sysprefs { > my $sysxml = "<sysprefs>\n"; > foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow > DisplayOPACiconsXSLT URLLinkText viewISBD >@@ -185,11 +185,14 @@ sub _get_xslt_sysprefs { > > sub XSLTParse4Display { > my ( $biblionumber, $orig_record, $xslsyspref, $fixamps, $hidden_items, $sysxml, $xslfilename, $lang ) = @_; >- #my $xslfilename = C4::Context->preference($xslsyspref); >+ >+ $sysxml ||= C4::Context->preference($xslsyspref); >+ $xslfilename ||= C4::Context->preference($xslsyspref); >+ $lang ||= C4::Languages::getlanguage(); >+ > if ( $xslfilename =~ /^\s*"?default"?\s*$/i ) { > my $htdocs; > my $theme; >- # my $lang = C4::Languages::getlanguage(); > my $xslfile; > if ($xslsyspref eq "XSLTDetailsDisplay") { > $htdocs = C4::Context->config('intrahtdocs'); >@@ -216,7 +219,6 @@ sub XSLTParse4Display { > } > > if ( $xslfilename =~ m/\{langcode\}/ ) { >- my $lang = C4::Languages::getlanguage(); > $xslfilename =~ s/\{langcode\}/$lang/; > } > >-- >2.7.0
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 15263
:
45221
|
48962
|
48963
|
49031
|
49159
|
49502
|
49503
|
49504
|
49505
|
50474
|
50506
|
50507
|
50508
|
50509
|
50510
|
50511