Bugzilla – Attachment 50508 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.17 KB, created by
Kyle M Hall (khall)
on 2016-04-21 13:42:34 UTC
(
hide
)
Description:
Bug 15263: (follow-up) XSLT display fetches sysprefs for every result processed
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-04-21 13:42:34 UTC
Size:
3.17 KB
patch
obsolete
>From 37f057554f5ff1267de2e99c2e8c640616b98bab 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. > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > 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 c876bd1..e6b5a88 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1877,7 +1877,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++ ) { >@@ -2209,7 +2209,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 9658d32..199f1f4 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -156,7 +156,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 >@@ -184,11 +184,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'); >@@ -215,7 +218,6 @@ sub XSLTParse4Display { > } > > if ( $xslfilename =~ m/\{langcode\}/ ) { >- my $lang = C4::Languages::getlanguage(); > $xslfilename =~ s/\{langcode\}/$lang/; > } > >-- >2.1.4
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