@@ -, +, @@ GetMarcNotes --- C4/Biblio.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -1803,7 +1803,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 @@ -1821,12 +1821,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 { --