Bugzilla – Attachment 23100 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), 5.81 KB, created by
Kyle M Hall (khall)
on 2013-11-22 17:47:19 UTC
(
hide
)
Description:
Bug 11242 - fix opac-MARCdetail.pl display and warnings
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-11-22 17:47:19 UTC
Size:
5.81 KB
patch
obsolete
>From 48c1a3ec96c5c88920ddfeb2ea8b84f6b412eb50 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 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> >--- > opac/opac-MARCdetail.pl | 62 +++++++++++++++++++++++++++------------------- > 1 files changed, 36 insertions(+), 26 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index d6be0a6..aaa565d 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -1,26 +1,28 @@ > #!/usr/bin/perl > >-# Copyright 2000-2002 Katipo Communications >-# Parts copyright 2010 BibLibre >-# > # This file is part of Koha. > # >-# Koha is free software; you can redistribute it and/or modify it under the >-# terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >-# version. >+# Copyright (C) 2000-2002 Katipo Communications >+# Parts Copyright (C) 2010 BibLibre >+# Parts Copyright (C) 2013 Mark Tompsett >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. > # >-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >-# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. > # >-# You should have received a copy of the GNU General Public License along >-# with Koha; if not, write to the Free Software Foundation, Inc., >-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ > > =head1 NAME > >-MARCdetail.pl : script to show a biblio in MARC format >+opac-MARCdetail.pl : script to show a biblio in MARC format > > =head1 SYNOPSIS > >@@ -41,8 +43,7 @@ the items attached to the biblio > > =cut > >-use strict; >-use warnings; >+use Modern::Perl; > > use C4::Auth; > use C4::Context; >@@ -172,12 +173,20 @@ 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,$lib); >+ $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}; >+ $lib = $sf_def->{lib} if defined($sf_def); >+ $lib = $lib // '--'; >+ $subfield_data{marc_lib} = ($lib eq $previous) ? '--' : $lib; >+ $previous = $lib; > $subfield_data{link} = $sf_def->{link}; > $subf[$i][1] =~ s/\n/<br\/>/g; > if ( $sf_def->{isurl} ) { >@@ -211,12 +220,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.2.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