Bugzilla – Attachment 33179 Details for
Bug 13170
Remove of prog theme broke the OPAC's "view plain" option for MARC details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13170 Remove of prog theme broke the OPAC's "view plain" option for MARC details
Bug-13170-Remove-of-prog-theme-broke-the-OPACs-vie.patch (text/plain), 4.00 KB, created by
Frédéric Demians
on 2014-11-03 22:53:08 UTC
(
hide
)
Description:
Bug 13170 Remove of prog theme broke the OPAC's "view plain" option for MARC details
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2014-11-03 22:53:08 UTC
Size:
4.00 KB
patch
obsolete
>From b82922951e9c36cbe448083afed3fdb63a43cf9c Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Sun, 2 Nov 2014 08:59:30 +0100 >Subject: [PATCH] Bug 13170 Remove of prog theme broke the OPAC's "view plain" > option for MARC details > >In the OPAC if you view the MARC details for a title (and have >OPACXSLTDetailsDisplay enabled) there is a "view plain" link which displays the >output of opac-showmarc.pl. This is broken in master: fixed by this patch. > >Note: Implemented with C4::XSLT::_get_best_default_xslt_filename() to keep code >orthogonal. > >Test plan: > >(1) Set OPACXSLTDetailsDisplay to default >(2) Do a search on OPAC, then display a specific biblio record >(3) Click on MARC view tab. Then click on 'view plain' link. Nothing is > displayed. >(4) Apply the patch. And refresh the MARC detail page. >(5) Click on 'view plain' link. Check that a plain text MARC record is > displayed. >--- > C4/XSLT.pm | 8 ++++++-- > opac/opac-showmarc.pl | 29 +++++++++-------------------- > 2 files changed, 15 insertions(+), 22 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a255b33..a87f870 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -139,12 +139,16 @@ The helper function _get_best_default_xslt_filename is used in a unit test. > sub _get_best_default_xslt_filename { > my ($htdocs, $theme, $lang, $base_xslfile) = @_; > >+ # Try to find the xsl file in various directory, in the following order. >+ # Depending on the interface the fallback theme is boostrap (opac) or prog >+ # (pro). > my @candidates = ( > "$htdocs/$theme/$lang/xslt/${base_xslfile}", # exact match > "$htdocs/$theme/en/xslt/${base_xslfile}", # if not, preferred theme in English >+ "$htdocs/bootstrap/$lang/xslt/${base_xslfile}", # if not, 'bootstrap' theme in preferred language >+ "$htdocs/bootstrap/en/xslt/${base_xslfile}", # otherwise, bootstrap theme in English > "$htdocs/prog/$lang/xslt/${base_xslfile}", # if not, 'prog' theme in preferred language >- "$htdocs/prog/en/xslt/${base_xslfile}", # otherwise, prog theme in English; should always >- # exist >+ "$htdocs/prog/en/xslt/${base_xslfile}", # otherwise, prog theme in English > ); > my $xslfilename; > foreach my $filename (@candidates) { >diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl >index 702fb1b..219186c 100755 >--- a/opac/opac-showmarc.pl >+++ b/opac/opac-showmarc.pl >@@ -52,26 +52,15 @@ if(!ref $record) { > } > > if ($view eq 'card' || $view eq 'html') { >- my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); >- my $xslfile; >- my $xslfilename; >- my $htdocs = C4::Context->config('opachtdocs'); >- my $theme = C4::Context->preference("opacthemes"); >- my $lang = C4::Languages::getlanguage($input); >- >- if ($view eq 'card'){ >- $xslfile = "compact.xsl"; >- } >- else { # must be html >- $xslfile = 'plainMARC.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 $xslfile ); >- $xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename ); >- >- my $newxmlrecord = C4::XSLT::engine->transform($xmlrecord, $xslfilename); >- print $input->header(-charset => 'UTF-8'), Encode::encode_utf8($newxmlrecord); >+ my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber); >+ my $xsl = C4::XSLT::_get_best_default_xslt_filename( >+ C4::Context->config('opachtdocs'), >+ C4::Context->preference('opacthemes'), >+ C4::Languages::getlanguage($input), >+ $view eq 'card' ? 'compact.xsl' : 'plainMARC.xsl' >+ ); >+ print $input->header(-charset => 'UTF-8'), >+ Encode::encode_utf8(C4::XSLT::engine->transform($xml, $xsl)); > } > else { #view eq marc > my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ >-- >2.1.2
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 13170
:
33128
|
33129
|
33179
|
33180
|
33181
|
33182