@@ -, +, @@ --- C4/Biblio.pm | 22 +++++++++++++++++----- C4/Items.pm | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -1992,11 +1992,10 @@ sub TransformKohaToMarc { my $tagsubfield = $fld->{tagsubfield}; next if !$tagfield; - # BZ 21800: split value if field is repeatable; NOTE that this also - # depends on the Default framework. - my @values = $params->{no_split} || !$fld->{repeatable} - ? ( $value ) - : split(/\s?\|\s?/, $value, -1); + # BZ 21800: split value if field is repeatable. + my @values = _check_split($params, $fld, $value) + ? split(/\s?\|\s?/, $value, -1) + : ( $value ); foreach my $value ( @values ) { next if $value eq ''; $tag_hr->{$tagfield} //= []; @@ -2017,6 +2016,19 @@ sub TransformKohaToMarc { return $record; } +sub _check_split { + my ($params, $fld, $value) = @_; + return if index($value,'|') == -1; # nothing to worry about + return if $params->{no_split}; + + # if we did not get a specific framework, check default in $mss + return $fld->{repeatable} if !$params->{framework}; + + # here we need to check the specific framework + my $mss = Koha::MarcSubfieldStructures->find( $params->{framework}, $fld->{tagfield}, $fld->{tagsubfield} ); + return 1 if $mss && $mss->repeatable; +} + =head2 PrepHostMarcField $hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour ) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1299,7 +1299,7 @@ sub Item2Marc { } keys %{ $itemrecord } }; my $framework = C4::Biblio::GetFrameworkCode( $biblionumber ); - my $itemmarc = C4::Biblio::TransformKohaToMarc( $mungeditem ); # Bug 21774: no_split parameter removed to allow cloned subfields + my $itemmarc = C4::Biblio::TransformKohaToMarc( $mungeditem, { framework => $framework } ); my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $framework, ); --