Bugzilla – Attachment 15902 Details for
Bug 9570
view plain not working in ccsr
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 9570 - view plain not working in ccsr
PASSED-QA-Bug-9570---view-plain-not-working-in-ccs.patch (text/plain), 2.78 KB, created by
Katrin Fischer
on 2013-03-06 07:12:45 UTC
(
hide
)
Description:
[PASSED QA] Bug 9570 - view plain not working in ccsr
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-03-06 07:12:45 UTC
Size:
2.78 KB
patch
obsolete
>From 25b7d83d83685523835f67db7f19d0078ac94ac1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 12 Feb 2013 11:05:07 -0500 >Subject: [PATCH] [PASSED QA] Bug 9570 - view plain not working in ccsr > >The code in opac-showmarc.pl isn't smart enough to find the xsl files in >the "default" (prog) theme if the ccsr theme is enabled, so the "view >plain" option on opac-MARCdetail.pl fails ever time. > >This patch copies some path-handling code from XSLT.pm to improve xsl >file path handling when dealing with a "sub-theme." > >To test, view the MARC view in the OPAC and click the "view plain" link. >This should work correctly in prog and ccsr themes and with different >languages enabled (keeping in mind the ccsr theme will fail in general >for languages other than en). > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Checked plain view works in both prog and ccsr themes now. >All tests and QA script pass. >--- > opac/opac-showmarc.pl | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > >diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl >index b958485..71fb804 100755 >--- a/opac/opac-showmarc.pl >+++ b/opac/opac-showmarc.pl >@@ -58,18 +58,26 @@ else { > if ($view eq 'card' || $view eq 'html') { > my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); > my $xslfile; >- my $themelang = '/' . C4::Context->preference("opacthemes") . '/' . C4::Templates::_current_language(); >+ my $xslfilename; >+ my $htdocs = C4::Context->config('opachtdocs'); >+ my $theme = C4::Context->preference("opacthemes"); >+ my $lang = C4::Templates::_current_language(); > > if ($view eq 'card'){ >- $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/compact.xsl"; >+ $xslfile = "compact.xsl"; > } > else { # must be html >- $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/MARC21slim2OPACMARCdetail.xsl"; >+ $xslfile = C4::Context->preference('marcflavour') . "slim2OPACMARCdetail.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 $parser = XML::LibXML->new(); > my $xslt = XML::LibXSLT->new(); > my $source = $parser->parse_string($xmlrecord); >- my $style_doc = $parser->parse_file($xslfile); >+ my $style_doc = $parser->parse_file($xslfilename); > my $stylesheet = $xslt->parse_stylesheet($style_doc); > my $results = $stylesheet->transform($source); > my $newxmlrecord = $stylesheet->output_string($results); >-- >1.7.9.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 9570
:
15149
|
15277
|
15283
| 15902