[Koha-bugs] [Bug 12229] tools/export.pl fix to forbid adding of invalid records

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 12 17:02:36 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12229

stephane.delaune at biblibre.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stephane.delaune at biblibre.c
                   |                            |om

--- Comment #1 from stephane.delaune at biblibre.com ---
Created attachment 28180
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28180&action=edit
proposed patch : fix to prevent adding of invalid records in marc file

Problem is :

When a too big record is generated to be add into an iso2709 file, a warning
"Record length of (too big integer here) is larger than the MARC spec allows
(99999 bytes)" is displayed.

in this case, it's only a warning so record is still generated (and added to
the iso2709 file) with the first 5 characters of the leader defined to the
maximum allow (99999). But this record is defective because the size defined in
the leader (99999), no longer corresponds to the real record's datas. 

After, when the exported file is open with MARC::File::USMARC, these too big
records generate errors.

Solution is to verify record's length before to prevent adding it in the file
if it's too big.

nb : 
- xml export does not have this problem (too big record's are not added to the
xml exported file),
- this fix can't be apply when record is open, because it can become too big
when adding too many items (addition that takes place in a second time) :
so I applied fix only for marc exports, before adding in file.

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


More information about the Koha-bugs mailing list