Bug 11242 - fix opac-MARCdetail.pl bizarre ordering of data and noisy warnings
Summary: fix opac-MARCdetail.pl bizarre ordering of data and noisy warnings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-13 12:20 UTC by Mark Tompsett
Modified: 2015-06-04 23:23 UTC (History)
5 users (show)

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


Attachments
Bug 11242 - fix opac-MARCdetail.pl display and warnings (3.31 KB, patch)
2013-11-13 21:08 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 11242 - fix opac-MARCdetail.pl display and warnings (3.46 KB, patch)
2013-11-13 21:45 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 11242 - fix opac-MARCdetail.pl display and warnings (5.71 KB, patch)
2013-11-14 02:51 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11242 - fix opac-MARCdetail.pl display and warnings (5.81 KB, patch)
2013-11-15 17:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Screenshots of my tests. (1.04 MB, application/zip)
2013-11-21 18:57 UTC, Mark Tompsett
Details
Bug 11242 - fix opac-MARCdetail.pl display and warnings (5.81 KB, patch)
2013-11-22 17:47 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2013-11-13 12:20:23 UTC
If the framework used by an MARC record does not have fields defined which were imported (e.g. imported 852$9, but BKS does not have that defined), the missing information generates a '--' as part of the OPAC description in 'MARC view', but separated from data to be displayed which is defined. This is in part due to the choice of || 0, instead of calculating the tab based on the tag (e.g. 852 => tab 8).

Additionally, this || 0 part happens in part because of a variable being undef, which causes some noisiness in the logs. So any undef potentially setting code related to $sf_def will be made less noisy.
Comment 1 Mark Tompsett 2013-11-13 12:22:12 UTC
This bug deals with the opac-MARCdetail noisiness that was found while trying to clean up OPAC noise in bug 11183.
Comment 2 Mark Tompsett 2013-11-13 21:08:13 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2013-11-13 21:45:06 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2013-11-14 02:51:20 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2013-11-15 17:14:23 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2013-11-21 15:21:51 UTC
Not sure to reproduce correctly the issue:
- choose a biblio, edit and add a value in 686$a
- delete the subfield 686$a in the framework
- go at the OPAC (marc view), I get:
686 ## - classification
-- 	existe pas
101 ## - Langue
langue doc. 	Français

I apply the patch, I get:
101 ## - Langue
langue doc. 	Français
686 ## - classification
-- 	existe pas

I certainly miss something...
Comment 7 Mark Tompsett 2013-11-21 18:57:26 UTC
Created attachment 23071 [details]
Screenshots of my tests.

I have attached a zip file of 5 screen shots.
Framework_Before.jpg - display showing a, b, and c subfields for 260.
Framework_After.jpg  - display showing that 'b' was deleted.
OPAC_BeforeBreak.jpg - initial OPAC display (only 1 260 block displayed)
OPAC_AfterBreak.jpg  - display after 'b' is deleted (2 260 blocks displayed).
OPAC_AfterPatch.jpg  - display after patch is applied (1 260 block displayed).

This 'deleting' of 260$b, would be the same if one changed the framework to not include something which is in the MARC for that record.
Comment 8 Kyle M Hall 2013-11-22 17:47:19 UTC
Created attachment 23100 [details] [review]
Bug 11242 - fix opac-MARCdetail.pl display and warnings

BACK UP YOUR DATABASE!
 1) Search for an item in OPAC
 2) Open OPAC detail
 3) Click 'MARC View' link
 4) Look for something with multiple lines (e.g. 260 or 942)
 5) In another tab, Go to staff client and log in
 6) Go to the staff client URL similar to:
     /cgi-bin/koha/catalogue/detail.pl?biblionumber=##### page
    where ##### is the biblionumber.
 7) Edit -> record
 8) Note the framework used.
 9) More -> Administration
10) MARC bibliographic frameworks
11) Click 'MARC structure' for the framework used by the item
     shown in OPAC.
12) Find the tag (e.g. 260 or 942) and click 'Subfields'
13) Delete of the matching subfields (e.g. 260$b) shown in the
     OPAC tab
14) Clear your opac error log.
15) Refresh OPAC tab. The tag subfields are split.
16) There are opac-MARCdetail.pl warnings.
17) Apply patch
18) Clear your opac error log.
19) Refresh OPAC tab. The tag subfields are no longer split strangely.
20) There are no opac-MARCdetail.pl warnings.
RESTORE YOUR DATABASE.

This also silences a series of warnings triggered by catching
undef hash references.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Galen Charlton 2013-11-29 14:54:57 UTC
Pushed to master.  Thanks, Mark!
Comment 10 Fridolin Somers 2013-12-13 15:00:25 UTC
This patch has been pushed to 3.14.x, will be in 3.14.1
Comment 11 Tomás Cohen Arazi 2013-12-23 15:25:42 UTC
This patch has been pushed to 3.12.x, will be in 3.12.8.

Thanks Mark!