Bugzilla – Attachment 98979 Details for
Bug 13574
Repeatable item subfields don't show correctly in MARC view (OPAC and staff)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13574: Fix display of repeatable item subfields
Bug-13574-Fix-display-of-repeatable-item-subfields.patch (text/plain), 3.63 KB, created by
Katrin Fischer
on 2020-02-14 16:54:08 UTC
(
hide
)
Description:
Bug 13574: Fix display of repeatable item subfields
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-02-14 16:54:08 UTC
Size:
3.63 KB
patch
obsolete
>From a36dffc7c4a56920540865d9607a74551f2ddca3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 10 Feb 2020 15:17:38 +0000 >Subject: [PATCH] Bug 13574: Fix display of repeatable item subfields > >Applies to OPAC and staff: opac-MARCdetail and catalogue/MARCdetail. > >Test plan: >[1] Pick an item. Pick two fields say URI and copy number, and fill these >with a value like A | B. (The pipe char is important.) >[2] Verify that the display of the item block on opac-MARCdetail shows >both A and B in those columns. (Previously only B was shown.) >[3] Verify the same on catalogue MARC detail, items tab. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Holly <hc@interleaf.ie> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > catalogue/MARCdetail.pl | 20 +++++++++++++++----- > opac/opac-MARCdetail.pl | 13 ++++++++++--- > 2 files changed, 25 insertions(+), 8 deletions(-) > >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index adfe24c192..7c250387bc 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -276,14 +276,24 @@ foreach my $field (@fields) { > for my $i ( 0 .. $#subf ) { > next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{tab} ne 10 ); > next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} =~ /-7|-4|-3|-2|2|3|5|8/); >+ > push @item_subfield_codes, $subf[$i][0]; > $witness{ $subf[$i][0] } = > $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib}; >- $item->{ $subf[$i][0] } = GetAuthorisedValueDesc( $field->tag(), >- $subf[$i][0], $subf[$i][1], '', $tagslib) || $subf[$i][1]; >- $norequests = 0 >- if $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{kohafield} eq 'items.notforloan' >- and $subf[$i][1] == 0; >+ >+ # Allow repeatables (BZ 13574) >+ if( $item->{$subf[$i][0]}) { >+ $item->{$subf[$i][0]} .= ' | '; >+ } else { >+ $item->{$subf[$i][0]} = q{}; >+ } >+ if( $tagslib->{$field->tag()}->{$subf[$i][0]}->{isurl} ) { >+ $item->{$subf[$i][0]} .= "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>"; >+ } else { >+ $item->{ $subf[$i][0] } .= GetAuthorisedValueDesc( $field->tag(), $subf[$i][0], $subf[$i][1], '', $tagslib) || $subf[$i][1]; >+ } >+ >+ $norequests = 0 if $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{kohafield} eq 'items.notforloan' and $subf[$i][1] == 0; > } > push @item_loop, $item if $item; > } >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 4bc9294b50..545af32f7f 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -293,14 +293,21 @@ foreach my $field (@fields) { > push @item_subfield_codes, $subf[$i][0]; > $witness{ $subf[$i][0] } = $sf_def->{lib}; > >+ # Allow repeatables (BZ 13574) >+ if( $item->{$subf[$i][0]} ) { >+ $item->{$subf[$i][0]} .= ' | '; >+ } else { >+ $item->{$subf[$i][0]} = q{}; >+ } >+ > if ( $sf_def->{isurl} ) { >- $item->{ $subf[$i][0] } = "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>"; >+ $item->{ $subf[$i][0] } .= "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>"; > } > elsif ( $sf_def->{kohafield} eq "biblioitems.isbn" ) { >- $item->{ $subf[$i][0] } = $subf[$i][1]; >+ $item->{ $subf[$i][0] } .= $subf[$i][1]; > } > else { >- $item->{ $subf[$i][0] } = GetAuthorisedValueDesc( $field->tag(), $subf[$i][0], >+ $item->{ $subf[$i][0] } .= GetAuthorisedValueDesc( $field->tag(), $subf[$i][0], > $subf[$i][1], '', $tagslib, '', 'opac' ); > } > } >-- >2.11.0
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 13574
:
98664
|
98790
|
98858
| 98979