View | Details | Raw Unified | Return to bug 21800
Collapse All | Expand All

(-)a/C4/Biblio.pm (-5 / +17 lines)
Lines 1998-2008 sub TransformKohaToMarc { Link Here
1998
            my $tagsubfield = $fld->{tagsubfield};
1998
            my $tagsubfield = $fld->{tagsubfield};
1999
            next if !$tagfield;
1999
            next if !$tagfield;
2000
2000
2001
            # BZ 21800: split value if field is repeatable; NOTE that this also
2001
            # BZ 21800: split value if field is repeatable.
2002
            # depends on the Default framework.
2002
            my @values = _check_split($params, $fld, $value)
2003
            my @values = $params->{no_split} || !$fld->{repeatable}
2003
                ? split(/\s?\|\s?/, $value, -1)
2004
                ? ( $value )
2004
                : ( $value );
2005
                : split(/\s?\|\s?/, $value, -1);
2006
            foreach my $value ( @values ) {
2005
            foreach my $value ( @values ) {
2007
                next if $value eq '';
2006
                next if $value eq '';
2008
                $tag_hr->{$tagfield} //= [];
2007
                $tag_hr->{$tagfield} //= [];
Lines 2023-2028 sub TransformKohaToMarc { Link Here
2023
    return $record;
2022
    return $record;
2024
}
2023
}
2025
2024
2025
sub _check_split {
2026
    my ($params, $fld, $value) = @_;
2027
    return if index($value,'|') == -1; # nothing to worry about
2028
    return if $params->{no_split};
2029
2030
    # if we did not get a specific framework, check default in $mss
2031
    return $fld->{repeatable} if !$params->{framework};
2032
2033
    # here we need to check the specific framework
2034
    my $mss = Koha::MarcSubfieldStructures->find( $params->{framework}, $fld->{tagfield}, $fld->{tagsubfield} );
2035
    return 1 if $mss && $mss->repeatable;
2036
}
2037
2026
=head2 PrepHostMarcField
2038
=head2 PrepHostMarcField
2027
2039
2028
    $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour )
2040
    $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour )
(-)a/C4/Items.pm (-2 / +1 lines)
Lines 1298-1304 sub Item2Marc { Link Here
1298
        } keys %{ $itemrecord } 
1298
        } keys %{ $itemrecord } 
1299
    };
1299
    };
1300
    my $framework = C4::Biblio::GetFrameworkCode( $biblionumber );
1300
    my $framework = C4::Biblio::GetFrameworkCode( $biblionumber );
1301
    my $itemmarc = C4::Biblio::TransformKohaToMarc( $mungeditem ); # Bug 21774: no_split parameter removed to allow cloned subfields
1301
    my $itemmarc = C4::Biblio::TransformKohaToMarc( $mungeditem, { framework => $framework } );
1302
    my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField(
1302
    my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField(
1303
        "items.itemnumber", $framework,
1303
        "items.itemnumber", $framework,
1304
    );
1304
    );
1305
- 

Return to bug 21800