Bugzilla – Attachment 99518 Details for
Bug 21800
TransformKohaToMarc should respect non-repeatability of item subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21800: Make TransformKohaToMarc aware of non-repeatable subfields
Bug-21800-Make-TransformKohaToMarc-aware-of-non-re.patch (text/plain), 2.29 KB, created by
Ere Maijala
on 2020-02-24 13:38:25 UTC
(
hide
)
Description:
Bug 21800: Make TransformKohaToMarc aware of non-repeatable subfields
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2020-02-24 13:38:25 UTC
Size:
2.29 KB
patch
obsolete
>From 518ddead7cbb8b1c8bfc73a1e3d5f7071b9a3385 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 13 Feb 2020 11:33:15 +0000 >Subject: [PATCH] Bug 21800: Make TransformKohaToMarc aware of non-repeatable > subfields > >If a kohafield (in Koha to MARC mappings) contains a pipe char (say A | B), >we split it up into two subfields A and B in MARC. >We will only do that for repeatable subfields now. If the field is not >repeatable, the value will just be 'A | B'. > >Note 1: As bug 10306 and its friends (19096) made the Default framework >authoritative, we do no longer have the frameworkcode in this routine. >Formally, we should check the corresponding framework. > >Note 2: Does this impact the reverse operation in TransformMarcToKoha? >No, the check on repeatable subfields is done in the interface and not >in TransformMarcToKoha. This routine simply translates two instances of the >same subfield, say A and B, into the value 'A | B' for a kohafield. Not >allowing two instances of a non-repeatable subfield is not in the scope of >this report. > >Test plan: >[1] Mark an item field as repeatable in the Default framework. > Edit an item. Insert A|B in this field and another not-repeatable > field. Save and reopen. Verify that the repeatable field is duplicated > and the other one contains the pipe character in the text box. >[2] Look for a repeatable subfield in MARC like e.g. 260$c. > Go to the cataloguing editor and add A|B in this field. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Ere Maijala <ere.maijala@helsinki.fi> >--- > C4/Biblio.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index f745b93d32..e1482cc41c 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1997,7 +1997,10 @@ sub TransformKohaToMarc { > my $tagfield = $fld->{tagfield}; > my $tagsubfield = $fld->{tagsubfield}; > next if !$tagfield; >- my @values = $params->{no_split} >+ >+ # 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); > foreach my $value ( @values ) { >-- >2.17.1
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 21800
:
98816
|
98817
|
99309
|
99310
|
99311
|
99312
|
99313
|
99517
|
99518
|
99519
|
99520
|
101364
|
101365
|
101366
|
101367
|
101667