Bug 21800: Make TransformKohaToMarc aware of non-repeatable subfields
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 13 Feb 2020 11:33:15 +0000 (11:33 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 10:54:46 +0000 (10:54 +0000)
commitf952067cb23f548a4d804bc64329fcba848b6b29
tree7d9335f29efd7e2e26a8fba93885aa0723e541ca
parent661702e6694da80820020c98cb3e63911ef32e8f
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>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Biblio.pm