[Koha-bugs] [Bug 10407] Allow MARCXML records to be imported with Tools/ Stage MARC records for import
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Aug 3 12:34:12 CEST 2017
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10407
Pete Edwards <koha at jsense.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |koha at jsense.co.uk
--- Comment #45 from Pete Edwards <koha at jsense.co.uk> ---
This change has broken my 'to_marc' plugin. Prior to this patch
stage-marc-import.pl would read the input file with this routine:
while (<$fh>) {
s/^\s+//;
s/\s+$//;
$marcrecord.=$_;
}
And the marcrecord string would end up getting passed to the to_marc function
in my plugin. Perhaps I was not using this as expected but this allowed me to
import an Excel (xls) file which my plugin parsed using Spreadsheet::ParseExcel
and then read to generate Marc records to be staged.
The changes now cause the file to be read in
ImportBatch::RecordsFromISO2709File and Marc records added to an array which is
passed to the to_marc function. The reading routine is:
while (<IN>) {
s/^\s+//;
s/\s+$//;
next unless $_; # skip if record has only whitespace, as might occur
# if file includes newlines between each MARC record
my ($marc_record, $charset_guessed, $char_errors) = MarcToUTF8Record($_,
$marc_type, $encoding);
push @marc_records, $marc_record;
...
}
So in my case I get an array of bad marc records.
Two questions:
1. Was I doing something I shouldn't have been able to and this fix has not
broken anything as sch - just done what it always intended?
2. Whatever the answer to the (1) it does seem to have changed the data being
passed to to_marc from scalar to array - surely that could break other people's
plugins?
I have not been able to find much by way of documentation about to_marc plugins
- am I missing something?
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list