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 Cooper <hc@interleaf.ie>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 3b3a84d272)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2020-02-10 15:17:38 +00:00 committed by Lucas Gass
parent e91edec0a6
commit 92af2c2dc7
2 changed files with 25 additions and 8 deletions

View File

@ -268,14 +268,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;
}

View File

@ -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' );
}
}