[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Aug 10 13:51:12 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #12 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Created attachment 65802
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65802&action=edit
[SIGNED OFF] Bug 19049: Fix regression on stage-marc-import with to_marc plugin

Bug 12412 added the use of to_marc plugins allowing arbitrary file formats
in stage-marc-import (as long as the plugins can handle them). The feature
was not very visible in the code, and when bug 10407 added the marcxml
format, it made some changes that broke the use of to_marc.

This patch restores the functionality by:
[1] Adding a sub RecordsFromMarcPlugin to ImportBatch.pm, specifically
    addressing the conversion from arbitrary formats to MARC::Record.
    The original to_marc interface is used: pass it the file contents,
    and it returns a string consisting of a number of MARC blobs separated
    by \x1D.
    Consequently, the call of to_marc is removed from routine
    BatchStageMarcRecords where it did not belong. The to_marc_plugin
    parameter is removed and two calls are adjusted accordingly.
[2] Instead of a separate combo with plugins, the format combo contains
    MARC, MARCXML and optionally some plugin formats.
[3] The code in stage-marc-import.pl now clearly shows the three main
    format types: MARC, MARCXML or plugin based.

Note: This patch restores more or less the situation after bug 12412, but
I would actually recommend to have the to_marc plugins return MARC::Record
objects instead of large text strings. In the second example I added a
to_marc plugin that actually converts MARC record objects to string format,
while RecordsFromMarcPlugin reconverts them to MARC::Records.

Test plan:
See second patch.

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list