Bugzilla – Attachment 22915 Details for
Bug 11242
fix opac-MARCdetail.pl bizarre ordering of data and noisy warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11242 - fix opac-MARCdetail.pl display and warnings
Bug-11242---fix-opac-MARCdetailpl-display-and-warn.patch (text/plain), 3.31 KB, created by
Mark Tompsett
on 2013-11-13 21:08:13 UTC
(
hide
)
Description:
Bug 11242 - fix opac-MARCdetail.pl display and warnings
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-11-13 21:08:13 UTC
Size:
3.31 KB
patch
obsolete
>From 35f92e1974b025e97a41bded6905106c95960faa Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 13 Nov 2013 15:55:24 -0500 >Subject: [PATCH] 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 /cgi-bin/koha/catalogue/detail.pl?biblionumber=##### page > 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 shown in the OPAC tab >--- > opac/opac-MARCdetail.pl | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index d6be0a6..26a4dc2 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -172,12 +172,19 @@ for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { > # loop through each subfield > for my $i ( 0 .. $#subf ) { > $subf[$i][0] = "@" unless defined($subf[$i][0]); >- my $sf_def = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }; >- next if ( ($sf_def->{tab}||0) != $tabloop ); >- next if ( ($sf_def->{hidden}||0) > 0 ); >+ my $sf_def = $tagslib->{ $fields[$x_i]->tag() }; >+ $sf_def = $sf_def->{ $subf[$i][0] } if defined($sf_def); >+ my ($tab,$hidden); >+ $tab = $sf_def->{tab} if defined($sf_def); >+ $tab = $tab // int($fields[$x_i]->tag()/100); >+ $hidden = $sf_def->{hidden} if defined($sf_def); >+ $hidden = $hidden // 0; >+ next if ( $tab != $tabloop ); >+ next if ( $hidden > 0 ); > my %subfield_data; >- $subfield_data{marc_lib} = ($sf_def->{lib} eq $previous) ? '--' : $sf_def->{lib}; >- $previous = $sf_def->{lib}; >+ my $lib = $sf_def->{lib} // ''; >+ $subfield_data{marc_lib} = ($lib eq $previous) ? '--' : $sf_def->{lib}; >+ $previous = $lib; > $subfield_data{link} = $sf_def->{link}; > $subf[$i][1] =~ s/\n/<br\/>/g; > if ( $sf_def->{isurl} ) { >@@ -211,12 +218,13 @@ for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { > $tag_data{tag} = $tagslib->{ $fields[$x_i]->tag() }->{lib}; > } > else { >- $tag_data{tag} = >- $fields[$x_i]->tag() >- . ' ' >+ my $sf_def = $tagslib->{ $fields[$x_i]->tag() }; >+ my $lib; >+ $lib = $sf_def->{lib} if defined($sf_def); >+ $lib = $lib // ''; >+ $tag_data{tag} = $fields[$x_i]->tag() . ' ' > . C4::Koha::display_marc_indicators($fields[$x_i]) >- . ' - ' >- . $tagslib->{ $fields[$x_i]->tag() }->{lib}; >+ . " - $lib"; > } > } > my @tmp = @subfields_data; >-- >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 11242
:
22915
|
22916
|
22922
|
22969
|
23071
|
23100