Bugzilla – Attachment 70941 Details for
Bug 18198
MARC21: Further improve handling of 5XX$u in GetMarcNotes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18198: MARC21: Further improve handling of 5XX$u in GetMarcNotes
Bug-18198-MARC21-Further-improve-handling-of-5XXu-.patch (text/plain), 2.59 KB, created by
Josef Moravec
on 2018-01-26 09:15:54 UTC
(
hide
)
Description:
Bug 18198: MARC21: Further improve handling of 5XX$u in GetMarcNotes
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-01-26 09:15:54 UTC
Size:
2.59 KB
patch
obsolete
>From 1f306770df9c5536bf1ede765780be297f698e51 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 2 Mar 2017 12:59:37 +0100 >Subject: [PATCH] Bug 18198: MARC21: Further improve handling of 5XX$u in > GetMarcNotes > >Bug 14306 only handled field 555 in MARC21 as an URI. But a lot of other >5XX fields have a $u subfield for URIs; actually $u is not used in any >other way. This patch generalizes the change made for 555 and extends >it to all 5XX $u. > >Test plan: >[1] Run t/Biblio.t >[2] Run t/db_dependent/Biblio.t >[3] Edit a MARC21 record. Add a URL into 505u, 520u, 555u. >[4] Check presentation on opac-detail (tab Title notes) >[5] Check presentation on catalogue/detail (tab Descriptions) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Biblio.pm | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index b9c4655..894ceb3 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1710,7 +1710,7 @@ sub GetMarcISSN { > > Get all notes from the MARC record and returns them in an array. > The notes are stored in different fields depending on MARC flavour. >- MARC21 field 555 gets special attention for the $u subfields. >+ MARC21 5XX $u subfields receive special attention as they are URIs. > > =cut > >@@ -1728,12 +1728,16 @@ sub GetMarcNotes { > foreach my $field ( $record->field($scope) ) { > my $tag = $field->tag(); > next if $blacklist{ $tag }; >- if( $marcflavour ne 'UNIMARC' && $tag =~ /555/ ) { >- # Field 555$u contains URLs >- # We first push the regular subfields and all $u's separately >- # Leave further actions to the template >- push @marcnotes, { marcnote => $field->as_string('abcd') }; >+ if( $marcflavour ne 'UNIMARC' && $field->subfield('u') ) { >+ # Field 5XX$u always contains URI >+ # Examples: 505u, 506u, 510u, 514u, 520u, 530u, 538u, 540u, 542u, 552u, 555u, 561u, 563u, 583u >+ # We first push the other subfields, then all $u's separately >+ # Leave further actions to the template (see e.g. opac-detail) >+ my $othersub = >+ join '', ( 'a' .. 't', 'v' .. 'z', '0' .. '9' ); # excl 'u' >+ push @marcnotes, { marcnote => $field->as_string($othersub) }; > foreach my $sub ( $field->subfield('u') ) { >+ $sub =~ s/^\s+|\s+$//g; # trim > push @marcnotes, { marcnote => $sub }; > } > } else { >-- >2.1.4
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 18198
:
60790
|
68170
| 70941 |
71085