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

Thomas Klausner <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #22 from Thomas Klausner <[email protected]> ---
Hi!

We've also encountered this problem (fields with val > 9999 bytes breaking),
esp since ElasticSearch uses an UNSMARC Dump stored in the index to render the
results. (Interestingly there is a workaround there to handle the whole record
being larger than 99999 bytes..)

Attached you can find a small script that shows the problematic behaviour
(subfield_to_large.pl). It will create a new MARC Record with a field > 9999
bytes, export it as USMARC, and then create a new MARC Record from this dump.
Basically what ES does in
Koha::SearchEngine::Elasticsearch->marc_records_to_documents
and
Koha::SearchEngine::Elasticsearch::Search->decode_record_from_result

This will trigger a bunch of warnings produce an invald Record:

Run it like this to produce the error: 
subfield_to_large.pl

Or pass any argument to shorten the data a bit, in which case it works:
subfield_to_large.pl 1


I also have a fix for MARC::File::USMARC->_build_tag_directory. BUT: there are
two ways to "fix" it:

a) throw an exception if invalid (=too long) data is passed
b) shorten the data to 9999 bytes

a) has the advantage of being correct and allowing whoever creates the data to
fix the data. But sometimes you don't have control over the data

b) is bad because it silently looses data (but it's smart enough to not cut
UTF8 chars in half..)

So maybe c) would be needed, which could somehow allow the user / Koha to set
either a) or b)


Anyway, I'm not sure how to get a patch into MARC::File::USMARC (or if Koha is
using the slightly old version from CPAN or a custom one)

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to