Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC
Summary: Make OPAC MARC plain view work for all flavours of MARC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Magnus Enger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-26 10:09 UTC by Fridolin Somers
Modified: 2015-06-04 23:30 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC (1.92 KB, patch)
2014-03-07 08:17 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC (2.01 KB, patch)
2014-03-07 12:59 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC (2.42 KB, patch)
2014-03-13 15:26 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED OFF] Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC (2.59 KB, patch)
2014-03-14 01:45 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC (2.76 KB, patch)
2014-03-14 11:08 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2013-07-26 10:09:07 UTC
Bug 9570 introduced the MARC flavor for OPAC MARC plain view, which was using MARC21slim2OPACMARCdetail.xsl.
The bug is that there are no files for UNIMARC and NORMARC flavors in actual sources.

Seems like MARC21slim2OPACMARCdetail.xsl has nothing specific to MARC21 flavor.

Should there be copies of MARC21slim2OPACMARCdetail.xsl named UNIMARCslim2OPACMARCdetail.xsl and NORMARCslim2OPACMARCdetail.xsl ?
Or should this XSLT not depend on MARC flavor like before ?
Comment 1 Galen Charlton 2013-07-26 17:04:47 UTC
(In reply to Fridolyn SOMERS from comment #0)
> Seems like MARC21slim2OPACMARCdetail.xsl has nothing specific to MARC21
> flavor.

I agree.

> Should there be copies of MARC21slim2OPACMARCdetail.xsl named
> UNIMARCslim2OPACMARCdetail.xsl and NORMARCslim2OPACMARCdetail.xsl ?
> Or should this XSLT not depend on MARC flavor like before ?

I think for this one the XSLT should not depend on the MARC flavor, unless somebody can point to examples where the convention for display plain tagged views of a MARC record are different for the UNIMARC community.
Comment 2 Magnus Enger 2014-03-07 07:54:44 UTC
I can confirm this bug. Clicking on the "view plain" link gives a Ajaxy "spinning wheel" and a "Loading..." message for a second or two, then a yellow warning saying "Sorry, plain view is temporarily unavailable."

I get this in the opac-error.log:

opac-showmarc.pl: Could not create file parser context for file "/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/xslt/NORMARCslim2OPACMARCdetail.xsl": No such file or directory at /usr/share/koha/opac/cgi-bin/opac/opac-showmarc.pl line 80, referer: http://kurs.demo.bibkat.no/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=18

...which seems to confirm that a missing XSLT file is the culprit. 

And I'm also seeing a ton of 500 errors in my Apache logs (from bots) for pages like this:

/cgi-bin/koha/opac-showmarc.pl?id=10611&viewas=html

...which is what that Ajax call is trying to fetch.
Comment 3 Magnus Enger 2014-03-07 08:17:09 UTC Comment hidden (obsolete)
Comment 4 Fridolin Somers 2014-03-07 12:59:09 UTC Comment hidden (obsolete)
Comment 5 Fridolin Somers 2014-03-07 13:00:42 UTC
Signed and added "OPACXSLTDetailsDisplay not empty" in test plan.

Very old and ugly bug, thanks Magnus :D
Comment 6 Marcel de Rooy 2014-03-13 11:42:50 UTC
QA Comment:
Good idea.
The patch works for bootstrap by the grace of the fallback in opac-showmarc.
You do only rename the file in prog. You should do the same for bootstrap.

But I personally do not really like the idea of renaming this one file from MARC21 to MARC. It is still listed very close to the MARC21 files.
[1] We could rename it more rigorously like plainMARC.xsl or something?
[2] Or we could leave the file as-is and create a file for UNIMARC and NORMARC just with an xsl:import? Something like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="MARC21slim2OPACMARCdetail.xsl"/>
</xsl:stylesheet>

Failed QA
Comment 7 Magnus Enger 2014-03-13 15:26:13 UTC Comment hidden (obsolete)
Comment 8 Mark Tompsett 2014-03-14 01:45:00 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2014-03-14 11:08:35 UTC
Created attachment 26338 [details] [review]
[PASSED QA] Bug 10647 - Make OPAC MARC plain view work for all flavours of MARC

On "MARC view" in the OPAC, clicking on "Plain view" does not work
for UNIMARC and NORMARC.

To test:
- Make sure you have a UNIMARC or NORMARC setup
- Go to the "MARC view" of a record in the OPAC
- Click on "view plain" and observe the "Sorry, plain view is
  temporarily unavailable." error message
- Apply the patch
- Click on "view plain" and observe that a plain view of the MARC
  record is now displayed
- Sign off

I have only tested this on NORMARC, it might be good if someone
can test on UNIMARC.

Updated 2014-03-13: Incoroprates changes suggested by Marcel.
Test plan is the same as before.

Updated 2014-03-13: Tested in my UNIMARC system.
toggled opactheme to all three values, with OPACXSLTDetailsDisplay
and OPACXSLTResultsDisplay both set to default.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with MARC21 and UNIMARC, passes all tests and QA script.
Comment 10 Galen Charlton 2014-03-14 15:20:32 UTC
Pushed to master.  Thanks, Magnus!
Comment 11 Fridolin Somers 2014-06-12 08:43:06 UTC
Pushed to 3.14.x, will be in 3.14.08