tools/export.pl it is able to add truncated or invalid records into the output iso2709 file, without error message. So if we want to read generated iso2709 file : script die
Created attachment 28180 [details] [review] 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.
Created attachment 28410 [details] [review] [SIGNED-oFF] Bug 12229: fix to prevent adding of invalid records in marc file Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described. No errors Test: 1. Edit record, add 100.000 chars text to 500a 2. xml export produce the record, 3. mrc export do not produce the record, warning on log export.pl: record (number 2025) length 102668 is larger than the MARC spec allows (99999 bytes) at...
Created attachment 28456 [details] [review] [PASSED QA] Bug 12229: fix to prevent adding of invalid records in marc file Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Work as described. No errors Test: 1. Edit record, add 100.000 chars text to 500a 2. xml export produce the record, 3. mrc export do not produce the record, warning on log export.pl: record (number 2025) length 102668 is larger than the MARC spec allows (99999 bytes) at... Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master and 3.16.x. Thanks, Stéphane!
Pushed to 3.14.x, will be in 3.14.12